aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorJesper Juhl <juhl-lkml@dif.dk>2005-06-21 17:17:30 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-21 19:07:48 -0700
commit990a8baf568ca1d0ae65e59783ff821794118d07 (patch)
tree1fe187b2f119f7a9d96d56380b211f9ddb9f8390 /drivers/md/md.c
parent[PATCH] md: make sure md/bitmap doesn't try to write a page with active writeback (diff)
downloadlinux-dev-990a8baf568ca1d0ae65e59783ff821794118d07.tar.xz
linux-dev-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/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)
if (mddev->unit == unit) {
mddev_get(mddev);
spin_unlock(&all_mddevs_lock);
- if (new)
- kfree(new);
+ kfree(new);
return mddev;
}
@@ -458,11 +457,8 @@ static int sb_equal(mdp_super_t *sb1, mdp_super_t *sb2)
ret = 1;
abort:
- if (tmp1)
- kfree(tmp1);
- if (tmp2)
- kfree(tmp2);
-
+ kfree(tmp1);
+ kfree(tmp2);
return ret;
}