From: Abdun Nihaal Date: Mon, 3 Nov 2025 15:21:39 +0000 (+0530) Subject: mtd: maps: pcmciamtd: fix potential memory leak in pcmciamtd_detach() X-Git-Url: https://gentwo.org/gitweb/?a=commitdiff_plain;h=a697c671cc317aac3714ac735a336346af15d025;p=linux%2F.git 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 Signed-off-by: Miquel Raynal --- diff --git a/drivers/mtd/maps/pcmciamtd.c b/drivers/mtd/maps/pcmciamtd.c index 2ac79e1cedd9..206a3c463e6e 100644 --- a/drivers/mtd/maps/pcmciamtd.c +++ b/drivers/mtd/maps/pcmciamtd.c @@ -665,6 +665,7 @@ static void pcmciamtd_detach(struct pcmcia_device *link) } pcmciamtd_release(link); + kfree(dev); }