aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid0.c
diff options
context:
space:
mode:
authorJesper Juhl <juhl-lkml@dif.dk>2005-06-21 20:17:30 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-21 22:07:48 -0400
commit990a8baf568ca1d0ae65e59783ff821794118d07 (patch)
tree1fe187b2f119f7a9d96d56380b211f9ddb9f8390 /drivers/md/raid0.c
parent8a5e9cf1d6626586ff08e49f400a006a9f0c3275 (diff)
[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.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index e7d934eca06f..e11dd14d0b43 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -371,10 +371,8 @@ static int raid0_run (mddev_t *mddev)
371 return 0; 371 return 0;
372 372
373out_free_conf: 373out_free_conf:
374 if (conf->strip_zone) 374 kfree(conf->strip_zone);
375 kfree(conf->strip_zone); 375 kfree(conf->devlist);
376 if (conf->devlist)
377 kfree (conf->devlist);
378 kfree(conf); 376 kfree(conf);
379 mddev->private = NULL; 377 mddev->private = NULL;
380out: 378out:
@@ -386,11 +384,11 @@ static int raid0_stop (mddev_t *mddev)
386 raid0_conf_t *conf = mddev_to_conf(mddev); 384 raid0_conf_t *conf = mddev_to_conf(mddev);
387 385
388 blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/ 386 blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/
389 kfree (conf->hash_table); 387 kfree(conf->hash_table);
390 conf->hash_table = NULL; 388 conf->hash_table = NULL;
391 kfree (conf->strip_zone); 389 kfree(conf->strip_zone);
392 conf->strip_zone = NULL; 390 conf->strip_zone = NULL;
393 kfree (conf); 391 kfree(conf);
394 mddev->private = NULL; 392 mddev->private = NULL;
395 393
396 return 0; 394 return 0;