Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mtd: maps: pcmciamtd: fix potential memory leak in pcmciamtd_detach()

The memory allocated for struct pcmciamtd_dev in pcmciamtd_probe() is
not freed in the corresponding remove function pcmciamtd_detach().
Fix that by freeing it in the remove function.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

authored by

Abdun Nihaal and committed by
Miquel Raynal
a697c671 c95de73d

+1
+1
drivers/mtd/maps/pcmciamtd.c
··· 665 665 } 666 666 667 667 pcmciamtd_release(link); 668 + kfree(dev); 668 669 } 669 670 670 671