aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sysfs/bin.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/sysfs/bin.c')
-rw-r--r--fs/sysfs/bin.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/sysfs/bin.c b/fs/sysfs/bin.c
index 9ec1c8539a5d..d3b9f5f07db1 100644
--- a/fs/sysfs/bin.c
+++ b/fs/sysfs/bin.c
@@ -147,7 +147,7 @@ static int open(struct inode * inode, struct file * file)
147 Error: 147 Error:
148 module_put(attr->attr.owner); 148 module_put(attr->attr.owner);
149 Done: 149 Done:
150 if (error && kobj) 150 if (error)
151 kobject_put(kobj); 151 kobject_put(kobj);
152 return error; 152 return error;
153} 153}
@@ -158,8 +158,7 @@ static int release(struct inode * inode, struct file * file)
158 struct bin_attribute * attr = to_bin_attr(file->f_path.dentry); 158 struct bin_attribute * attr = to_bin_attr(file->f_path.dentry);
159 u8 * buffer = file->private_data; 159 u8 * buffer = file->private_data;
160 160
161 if (kobj) 161 kobject_put(kobj);
162 kobject_put(kobj);
163 module_put(attr->attr.owner); 162 module_put(attr->attr.owner);
164 kfree(buffer); 163 kfree(buffer);
165 return 0; 164 return 0;