Skip to content

Commit a697c67

Browse files
Abdun Nihaalmiquelraynal
authored andcommitted
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>
1 parent c95de73 commit a697c67

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/mtd/maps/pcmciamtd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,7 @@ static void pcmciamtd_detach(struct pcmcia_device *link)
665665
}
666666

667667
pcmciamtd_release(link);
668+
kfree(dev);
668669
}
669670

670671

0 commit comments

Comments
 (0)