Skip to content

Commit

Permalink
[PATCH] Driver core: small cleanup; remove check for NULL before kfre…
Browse files Browse the repository at this point in the history
…e() 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 <jesper.juhl@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Jesper Juhl authored and Greg Kroah-Hartman committed Sep 5, 2005
1 parent ceaeade commit fef6ec8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/base/class.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fef6ec8

Please sign in to comment.