From jesper.juhl@gmail.com Wed Aug 17 14:28:20 2005 From: Jesper Juhl To: Greg Kroah-Hartman Subject: Driver core: small cleanup; remove check for NULL before kfree() in driver core Date: Wed, 17 Aug 2005 22:06:34 +0200 Cc: Maneesh Soni Message-Id: <200508172206.34913.jesper.juhl@gmail.com> Remove needless checking of variable for NULL before calling kfree() on it. Applies to 2.6.13-rc6-git9 Signed-off-by: Jesper Juhl Signed-off-by: Greg Kroah-Hartman --- 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);