diff options
author | Jesper Juhl <juhl-lkml@dif.dk> | 2005-06-21 17:17:30 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-21 19:07:48 -0700 |
commit | 990a8baf568ca1d0ae65e59783ff821794118d07 (patch) | |
tree | 1fe187b2f119f7a9d96d56380b211f9ddb9f8390 /drivers/md/raid0.c | |
parent | 8a5e9cf1d6626586ff08e49f400a006a9f0c3275 (diff) | |
download | linux-3.10-990a8baf568ca1d0ae65e59783ff821794118d07.tar.gz linux-3.10-990a8baf568ca1d0ae65e59783ff821794118d07.tar.bz2 linux-3.10-990a8baf568ca1d0ae65e59783ff821794118d07.zip |
[PATCH] md: remove unneeded NULL checks before kfree
This patch removes some unneeded checks of pointers being NULL before
calling kfree() on them. kfree() handles NULL pointers just fine, checking
first is pointless.
Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md/raid0.c')
-rw-r--r-- | drivers/md/raid0.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index e7d934eca06..e11dd14d0b4 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c @@ -371,10 +371,8 @@ static int raid0_run (mddev_t *mddev) return 0; out_free_conf: - if (conf->strip_zone) - kfree(conf->strip_zone); - if (conf->devlist) - kfree (conf->devlist); + kfree(conf->strip_zone); + kfree(conf->devlist); kfree(conf); mddev->private = NULL; out: @@ -386,11 +384,11 @@ static int raid0_stop (mddev_t *mddev) raid0_conf_t *conf = mddev_to_conf(mddev); blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/ - kfree (conf->hash_table); + kfree(conf->hash_table); conf->hash_table = NULL; - kfree (conf->strip_zone); + kfree(conf->strip_zone); conf->strip_zone = NULL; - kfree (conf); + kfree(conf); mddev->private = NULL; return 0; |