aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sysfs/bin.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-07 22:22:26 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-07 22:22:26 -0500
commitf2aca47dc3c2d0c2d5dbd972558557e74232bbce (patch)
treeeae58f599a25a1f3ab41bf616a2b7c4b3c6e2277 /fs/sysfs/bin.c
parent7677ced48e2bbbb8d847d34f37e5d96d2b0e41e4 (diff)
parentb592fcfe7f06c15ec11774b5be7ce0de3aa86e73 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6: (28 commits) sysfs: Shadow directory support Driver Core: Increase the default timeout value of the firmware subsystem Driver core: allow to delay the uevent at device creation time Driver core: add device_type to struct device Driver core: add uevent vars for devices of a class SYSFS: Fix missing include of list.h in sysfs.h HOWTO: Add a reference to Harbison and Steele sysfs: error handling in sysfs, fill_read_buffer() kobject: kobject_put cleanup sysfs: kobject_put cleanup sysfs: suppress lockdep warnings Driver core: fix race in sysfs between sysfs_remove_file() and read()/write() driver core: Change function call order in device_bind_driver(). driver core: Don't stop probing on ->probe errors. driver core fixes: device_register() retval check in platform.c driver core fixes: make_class_name() retval checks /sys/modules/*/holders USB: add the sysfs driver name to all modules SERIO: add the sysfs driver name to all modules PCI: add the sysfs driver name to all modules ...
Diffstat (limited to 'fs/sysfs/bin.c')
-rw-r--r--fs/sysfs/bin.c6
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;