diff options
Diffstat (limited to 'fs/sysfs/bin.c')
-rw-r--r-- | fs/sysfs/bin.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/sysfs/bin.c b/fs/sysfs/bin.c index e8f540d38d48..d3b9f5f07db1 100644 --- a/fs/sysfs/bin.c +++ b/fs/sysfs/bin.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/slab.h> | 16 | #include <linux/slab.h> |
17 | 17 | ||
18 | #include <asm/uaccess.h> | 18 | #include <asm/uaccess.h> |
19 | #include <asm/semaphore.h> | ||
19 | 20 | ||
20 | #include "sysfs.h" | 21 | #include "sysfs.h" |
21 | 22 | ||
@@ -146,7 +147,7 @@ static int open(struct inode * inode, struct file * file) | |||
146 | Error: | 147 | Error: |
147 | module_put(attr->attr.owner); | 148 | module_put(attr->attr.owner); |
148 | Done: | 149 | Done: |
149 | if (error && kobj) | 150 | if (error) |
150 | kobject_put(kobj); | 151 | kobject_put(kobj); |
151 | return error; | 152 | return error; |
152 | } | 153 | } |
@@ -157,8 +158,7 @@ static int release(struct inode * inode, struct file * file) | |||
157 | struct bin_attribute * attr = to_bin_attr(file->f_path.dentry); | 158 | struct bin_attribute * attr = to_bin_attr(file->f_path.dentry); |
158 | u8 * buffer = file->private_data; | 159 | u8 * buffer = file->private_data; |
159 | 160 | ||
160 | if (kobj) | 161 | kobject_put(kobj); |
161 | kobject_put(kobj); | ||
162 | module_put(attr->attr.owner); | 162 | module_put(attr->attr.owner); |
163 | kfree(buffer); | 163 | kfree(buffer); |
164 | return 0; | 164 | return 0; |