Commit 06305643 authored by Simon Ruderich's avatar Simon Ruderich
Browse files

slsm: add casts

parent 1f12bf86
......@@ -104,7 +104,7 @@ static int passt_bprm_set_creds(struct linux_binprm *bprm) {
/* buffer freed below, name is pointer into buffer */
name = passt_get_path(&bprm->file->f_path, &buffer);
if (IS_ERR(name)) {
error = PTR_ERR(name);
error = (int)PTR_ERR(name);
name = bprm->filename;
goto audit;
}
......@@ -175,7 +175,7 @@ static int passt_path_common(const struct path *path, const struct cred *cred,
name = passt_get_path(path, &buffer);
if (IS_ERR(name)) {
error = PTR_ERR(name);
error = (int)PTR_ERR(name);
goto cleanup;
}
......@@ -223,14 +223,14 @@ static int passt_path_link(struct dentry *old_dentry, struct path *new_dir,
target_name = passt_get_path(&target, &target_buffer);
if (IS_ERR(target_name)) {
ret = PTR_ERR(target_name);
ret = (int)PTR_ERR(target_name);
goto cleanup;
}
perms = slsm_query_perms(target_name, pt->label);
link_name = passt_get_path(&link, &link_buffer);
if (IS_ERR(link_name)) {
ret = PTR_ERR(link_name);
ret = (int)PTR_ERR(link_name);
goto cleanup;
}
would_get = slsm_query_perms(link_name, pt->label);
......
......@@ -136,7 +136,7 @@ static int __init create_passtfs(void)
passtfs_dir = securityfs_create_dir("slsm", NULL);
if (IS_ERR(passtfs_dir)) {
printk(KERN_ERR "slsm: unable to create securityfs dir\n");
return PTR_ERR(passtfs_dir);
return (int)PTR_ERR(passtfs_dir);
}
passtfs_profiles = securityfs_create_file("profiles", 0600, passtfs_dir,
......@@ -144,7 +144,7 @@ static int __init create_passtfs(void)
if (IS_ERR(passtfs_profiles)) {
securityfs_remove(passtfs_dir);
printk(KERN_ERR "slsm: unable to create securityfs file\n");
return PTR_ERR(passtfs_profiles);
return (int)PTR_ERR(passtfs_profiles);
}
return 0;
......
......@@ -57,7 +57,7 @@ static const char *next_path_component(const char **path, size_t *length) {
const char *start = *path;
const char *next = strchr(*path, '/');
if (next) {
*length = next - start;
*length = (size_t)(next - start);
next++; /* skip '/' */
} else {
*length = strlen(start);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment