summaryrefslogtreecommitdiffstats
path: root/fs/sysfs/file.c
diff options
context:
space:
mode:
authorMariusz Kozlowski <m.kozlowski@tuxland.pl>2007-01-02 13:41:10 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2007-02-07 19:37:13 +0100
commitf75065367077bd3b77842a5aa523ecd05d33e82d (patch)
tree8c88382e578c2df7ff14ec005ae821dd4b36379e /fs/sysfs/file.c
parentsysfs: suppress lockdep warnings (diff)
downloadlinux-f75065367077bd3b77842a5aa523ecd05d33e82d.tar.xz
linux-f75065367077bd3b77842a5aa523ecd05d33e82d.zip
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>
Diffstat (limited to 'fs/sysfs/file.c')
-rw-r--r--fs/sysfs/file.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index cba4c1c7383c..46618f81ae48 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -361,7 +361,7 @@ static int sysfs_open_file(struct inode *inode, struct file *file)
error = -EACCES;
module_put(attr->owner);
Done:
- if (error && kobj)
+ if (error)
kobject_put(kobj);
return error;
}
@@ -375,8 +375,7 @@ static int sysfs_release(struct inode * inode, struct file * filp)
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);