summaryrefslogtreecommitdiffstats
path: root/drivers/base/class.c
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-08-18 22:14:39 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-08-18 22:14:39 -0400
commita3bc068022b968a3042b48eb9a8e8b0418fb9cdd (patch)
tree6bbc2806756924105802f4584157396fb98d282c /drivers/base/class.c
parent54cfb5aa0f4859bd38706eabe0118175780a542f (diff)
parent91aa9fb573fcc50bc74d5ee64c7e9b36131f1804 (diff)
downloadop-kernel-dev-a3bc068022b968a3042b48eb9a8e8b0418fb9cdd.zip
op-kernel-dev-a3bc068022b968a3042b48eb9a8e8b0418fb9cdd.tar.gz
Merge /spare/repo/linux-2.6/
Diffstat (limited to 'drivers/base/class.c')
-rw-r--r--drivers/base/class.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/base/class.c b/drivers/base/class.c
index 479c125..0154a16 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -299,6 +299,11 @@ static void class_dev_release(struct kobject * kobj)
pr_debug("device class '%s': release.\n", cd->class_id);
+ if (cd->devt_attr) {
+ kfree(cd->devt_attr);
+ cd->devt_attr = NULL;
+ }
+
if (cls->release)
cls->release(cd);
else {
@@ -591,11 +596,8 @@ void class_device_del(struct class_device *class_dev)
if (class_dev->dev)
sysfs_remove_link(&class_dev->kobj, "device");
- if (class_dev->devt_attr) {
+ if (class_dev->devt_attr)
class_device_remove_file(class_dev, class_dev->devt_attr);
- kfree(class_dev->devt_attr);
- class_dev->devt_attr = NULL;
- }
class_device_remove_attrs(class_dev);
kobject_hotplug(&class_dev->kobj, KOBJ_REMOVE);
OpenPOWER on IntegriCloud