diff options
author | Jesper Juhl <jesper.juhl@gmail.com> | 2005-11-07 04:01:27 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-07 10:54:02 -0500 |
commit | fa671646f61182cd18234461a6e65f50c6558695 (patch) | |
tree | 79d5fe8cbfdf9670456538837e60c695e6875006 /drivers/mtd/nftlcore.c | |
parent | c9475cb0c358ff0dd473544280d92482df491913 (diff) |
[PATCH] kfree cleanup: drivers/mtd
This is the drivers/mtd part of the big kfree cleanup patch.
Remove pointless checks for NULL prior to calling kfree() in drivers/mtd/.
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Acked-by: Joern Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/mtd/nftlcore.c')
-rw-r--r-- | drivers/mtd/nftlcore.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/mtd/nftlcore.c b/drivers/mtd/nftlcore.c index b2014043634f..062ff3877536 100644 --- a/drivers/mtd/nftlcore.c +++ b/drivers/mtd/nftlcore.c | |||
@@ -114,10 +114,8 @@ static void nftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) | |||
114 | } | 114 | } |
115 | 115 | ||
116 | if (add_mtd_blktrans_dev(&nftl->mbd)) { | 116 | if (add_mtd_blktrans_dev(&nftl->mbd)) { |
117 | if (nftl->ReplUnitTable) | 117 | kfree(nftl->ReplUnitTable); |
118 | kfree(nftl->ReplUnitTable); | 118 | kfree(nftl->EUNtable); |
119 | if (nftl->EUNtable) | ||
120 | kfree(nftl->EUNtable); | ||
121 | kfree(nftl); | 119 | kfree(nftl); |
122 | return; | 120 | return; |
123 | } | 121 | } |
@@ -133,10 +131,8 @@ static void nftl_remove_dev(struct mtd_blktrans_dev *dev) | |||
133 | DEBUG(MTD_DEBUG_LEVEL1, "NFTL: remove_dev (i=%d)\n", dev->devnum); | 131 | DEBUG(MTD_DEBUG_LEVEL1, "NFTL: remove_dev (i=%d)\n", dev->devnum); |
134 | 132 | ||
135 | del_mtd_blktrans_dev(dev); | 133 | del_mtd_blktrans_dev(dev); |
136 | if (nftl->ReplUnitTable) | 134 | kfree(nftl->ReplUnitTable); |
137 | kfree(nftl->ReplUnitTable); | 135 | kfree(nftl->EUNtable); |
138 | if (nftl->EUNtable) | ||
139 | kfree(nftl->EUNtable); | ||
140 | kfree(nftl); | 136 | kfree(nftl); |
141 | } | 137 | } |
142 | 138 | ||