[PATCH] small cleanup; remove check for NULL before kfree() in driver core

From: Jesper Juhl
Date: Wed Aug 17 2005 - 15:06:25 EST


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

Signed-off-by: Jesper Juhl <jesper.juhl@xxxxxxxxx>
---

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

--- linux-2.6.13-rc6-git9-orig/drivers/base/class.c 2005-08-17 21:53:53.000000000 +0200
+++ linux-2.6.13-rc6-git9/drivers/base/class.c 2005-08-17 21:57:26.000000000 +0200
@@ -299,10 +299,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);



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/