sysfs: kobject_put cleanup
This patch removes redundant argument checks for kobject_put(). Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
d3fc373ac5
commit
f750653670
|
@ -147,7 +147,7 @@ static int open(struct inode * inode, struct file * file)
|
||||||
Error:
|
Error:
|
||||||
module_put(attr->attr.owner);
|
module_put(attr->attr.owner);
|
||||||
Done:
|
Done:
|
||||||
if (error && kobj)
|
if (error)
|
||||||
kobject_put(kobj);
|
kobject_put(kobj);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
@ -158,8 +158,7 @@ static int release(struct inode * inode, struct file * file)
|
||||||
struct bin_attribute * attr = to_bin_attr(file->f_path.dentry);
|
struct bin_attribute * attr = to_bin_attr(file->f_path.dentry);
|
||||||
u8 * buffer = file->private_data;
|
u8 * buffer = file->private_data;
|
||||||
|
|
||||||
if (kobj)
|
kobject_put(kobj);
|
||||||
kobject_put(kobj);
|
|
||||||
module_put(attr->attr.owner);
|
module_put(attr->attr.owner);
|
||||||
kfree(buffer);
|
kfree(buffer);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -361,7 +361,7 @@ static int sysfs_open_file(struct inode *inode, struct file *file)
|
||||||
error = -EACCES;
|
error = -EACCES;
|
||||||
module_put(attr->owner);
|
module_put(attr->owner);
|
||||||
Done:
|
Done:
|
||||||
if (error && kobj)
|
if (error)
|
||||||
kobject_put(kobj);
|
kobject_put(kobj);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
@ -375,8 +375,7 @@ static int sysfs_release(struct inode * inode, struct file * filp)
|
||||||
|
|
||||||
if (buffer)
|
if (buffer)
|
||||||
remove_from_collection(buffer, inode);
|
remove_from_collection(buffer, inode);
|
||||||
if (kobj)
|
kobject_put(kobj);
|
||||||
kobject_put(kobj);
|
|
||||||
/* After this point, attr should not be accessed. */
|
/* After this point, attr should not be accessed. */
|
||||||
module_put(owner);
|
module_put(owner);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue