diff options
-rw-r--r-- | drivers/base/class.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/base/class.c b/drivers/base/class.c index d207296b18dc..d164c32a97ad 100644 --- a/drivers/base/class.c +++ b/drivers/base/class.c | |||
@@ -299,10 +299,8 @@ static void class_dev_release(struct kobject * kobj) | |||
299 | 299 | ||
300 | pr_debug("device class '%s': release.\n", cd->class_id); | 300 | pr_debug("device class '%s': release.\n", cd->class_id); |
301 | 301 | ||
302 | if (cd->devt_attr) { | 302 | kfree(cd->devt_attr); |
303 | kfree(cd->devt_attr); | 303 | cd->devt_attr = NULL; |
304 | cd->devt_attr = NULL; | ||
305 | } | ||
306 | 304 | ||
307 | if (cls->release) | 305 | if (cls->release) |
308 | cls->release(cd); | 306 | cls->release(cd); |