From: Jesper Juhl Date: Wed, 17 Aug 2005 20:06:34 +0000 (+0200) Subject: [PATCH] Driver core: small cleanup; remove check for NULL before kfree() in driver... X-Git-Tag: v2.6.14-rc1~751^2~1 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=fef6ec8dd96205fb22e3cfe2e4abd69d89413631;p=linux-2.6-omap-h63xx.git [PATCH] Driver core: small cleanup; remove check for NULL before kfree() in driver core 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 --- diff --git a/drivers/base/class.c b/drivers/base/class.c index d207296b18d..d164c32a97a 100644 --- a/drivers/base/class.c +++ b/drivers/base/class.c @@ -299,10 +299,8 @@ 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; - } + kfree(cd->devt_attr); + cd->devt_attr = NULL; if (cls->release) cls->release(cd);