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>
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index cba4c1c..46618f8 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -361,7 +361,7 @@
error = -EACCES;
module_put(attr->owner);
Done:
- if (error && kobj)
+ if (error)
kobject_put(kobj);
return error;
}
@@ -375,8 +375,7 @@
if (buffer)
remove_from_collection(buffer, inode);
- if (kobj)
- kobject_put(kobj);
+ kobject_put(kobj);
/* After this point, attr should not be accessed. */
module_put(owner);