summaryrefslogtreecommitdiff
path: root/drivers/md/raid1.c
diff options
context:
space:
mode:
authorJesper Juhl <juhl-lkml@dif.dk>2005-06-22 00:17:30 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-22 02:07:48 (GMT)
commit990a8baf568ca1d0ae65e59783ff821794118d07 (patch)
tree1fe187b2f119f7a9d96d56380b211f9ddb9f8390 /drivers/md/raid1.c
parent8a5e9cf1d6626586ff08e49f400a006a9f0c3275 (diff)
downloadlinux-990a8baf568ca1d0ae65e59783ff821794118d07.tar.xz
[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/raid1.c')
-rw-r--r--drivers/md/raid1.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 98b0977..ff1dbec 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1427,10 +1427,8 @@ out_free_conf:
if (conf) {
if (conf->r1bio_pool)
mempool_destroy(conf->r1bio_pool);
- if (conf->mirrors)
- kfree(conf->mirrors);
- if (conf->poolinfo)
- kfree(conf->poolinfo);
+ kfree(conf->mirrors);
+ kfree(conf->poolinfo);
kfree(conf);
mddev->private = NULL;
}
@@ -1447,10 +1445,8 @@ static int stop(mddev_t *mddev)
blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/
if (conf->r1bio_pool)
mempool_destroy(conf->r1bio_pool);
- if (conf->mirrors)
- kfree(conf->mirrors);
- if (conf->poolinfo)
- kfree(conf->poolinfo);
+ kfree(conf->mirrors);
+ kfree(conf->poolinfo);
kfree(conf);
mddev->private = NULL;
return 0;