1
0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2026-01-11 17:10:13 +00:00

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>
This commit is contained in:
Abdun Nihaal 2025-11-03 20:51:39 +05:30 committed by Miquel Raynal
parent c95de73da1
commit a697c671cc

View File

@ -665,6 +665,7 @@ static void pcmciamtd_detach(struct pcmcia_device *link)
}
pcmciamtd_release(link);
kfree(dev);
}