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

mmc: possible leak in mmc_read_ext_csd

The exception path associated with an invalid ext_csd_struct returns
without freeing ext_csd.

Coverity CID 1909.

Signed-off-by: Florin Malita
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>

authored by

Florin Malita and committed by
Pierre Ossman
00cedfa6 e6d5a11d

+2 -1
+2 -1
drivers/mmc/core/mmc.c
··· 213 213 printk(KERN_ERR "%s: unrecognised EXT_CSD structure " 214 214 "version %d\n", mmc_hostname(card->host), 215 215 ext_csd_struct); 216 - return -EINVAL; 216 + err = -EINVAL; 217 + goto out; 217 218 } 218 219 219 220 if (ext_csd_struct >= 2) {