Subject: Driver core: small cleanup; remove check for NULL before kfree() in driver core

From: Jesper Juhl <[email-masked]>
Date: Wed, 17 Aug 2005 22:06:34 +0200

Remove needless checking of variable for NULL before calling kfree() on it.
Applies to 2.6.13-rc6-git9

Signed-off-by: Jesper Juhl <[email-masked]>
Signed-off-by: Greg Kroah-Hartman <[email-masked]>

---
 drivers/base/class.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

--- gregkh-2.6.orig/drivers/base/class.c	2005-08-19 00:21:32.000000000 -0700
+++ gregkh-2.6/drivers/base/class.c	2005-08-19 00:21:34.000000000 -0700
@@ -300,10 +300,8 @@ static void class_dev_release(struct kob
 
 	pr_debug("device class '%s': release.\n", cd->class_id);
 
-	if (cd->devt_attr) {
-		kfree(cd->devt_attr);
-		cd->devt_attr = NULL;
-	}
+	kfree(cd->devt_attr);
+	cd->devt_attr = NULL;
 
 	if (cls->release)
 		cls->release(cd);