aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.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/md.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/md.c')
-rw-r--r--drivers/md/md.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 65fab74ad737..0c6b5b6baff6 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -195,8 +195,7 @@ static mddev_t * mddev_find(dev_t unit)
195 if (mddev->unit == unit) { 195 if (mddev->unit == unit) {
196 mddev_get(mddev); 196 mddev_get(mddev);
197 spin_unlock(&all_mddevs_lock); 197 spin_unlock(&all_mddevs_lock);
198 if (new) 198 kfree(new);
199 kfree(new);
200 return mddev; 199 return mddev;
201 } 200 }
202 201
@@ -458,11 +457,8 @@ static int sb_equal(mdp_super_t *sb1, mdp_super_t *sb2)
458 ret = 1; 457 ret = 1;
459 458
460abort: 459abort:
461 if (tmp1) 460 kfree(tmp1);
462 kfree(tmp1); 461 kfree(tmp2);
463 if (tmp2)
464 kfree(tmp2);
465
466 return ret; 462 return ret;
467} 463}
468 464