[MTD] Fix potential leak in rfd_ftl_add_mtd
This fixes a leak in the !mtd->erasesize error path (Coverity 1765). Signed-off-by: Florin Malita <fmalita@gmail.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
This commit is contained in:
parent
b8e3ec30c2
commit
47af05dd4b
|
@ -779,6 +779,7 @@ static void rfd_ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
|
||||||
else {
|
else {
|
||||||
if (!mtd->erasesize) {
|
if (!mtd->erasesize) {
|
||||||
printk(KERN_WARNING PREFIX "please provide block_size");
|
printk(KERN_WARNING PREFIX "please provide block_size");
|
||||||
|
kfree(part);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue