Commit ed565b37 authored by Lukas Braun's avatar Lukas Braun Committed by Simon Ruderich
Browse files

slsm: passtfs: remove useless struct securityfs_files

Also fixes wrong return PTR_ERR() in create_passtfs().
parent f7ea6504
......@@ -16,12 +16,9 @@ struct passtfs_privdata {
unsigned dirty:1;
};
struct securityfs_files {
struct dentry *dir;
struct dentry *profiles;
};
static struct dentry *passtfs_dir;
static struct dentry *passtfs_profiles;
static struct securityfs_files fs_files;
int profiles_open(struct inode *inode, struct file *file)
{
......@@ -130,23 +127,20 @@ static int __init create_passtfs(void)
if (!security_module_enable("passt"))
return 0;
fs_files.dir = securityfs_create_dir("slsm", NULL);
if (IS_ERR(fs_files.dir)) {
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(fs_files.dir);
return PTR_ERR(passtfs_dir);
}
fs_files.profiles = securityfs_create_file("profiles", 0600, fs_files.dir,
passtfs_profiles = securityfs_create_file("profiles", 0600, passtfs_dir,
NULL, &fs_fops_profiles);
if (IS_ERR(fs_files.profiles)) {
fs_files.profiles = NULL;
securityfs_remove(fs_files.dir);
if (IS_ERR(passtfs_profiles)) {
securityfs_remove(passtfs_dir);
printk(KERN_ERR "slsm: unable to create securityfs file\n");
return PTR_ERR(fs_files.dir);
return PTR_ERR(passtfs_profiles);
}
printk(KERN_INFO "slsm filesystem is present now!\n");
return 0;
}
fs_initcall(create_passtfs);
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