Skip to contentSkip to conversation

mmc: possible leak in mmc_read_ext_csd

PATCH In review Florin Malita 2 participants 2 messages Oct 13, 2007 – Oct 17, 2007 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

---

drivers/mmc/core/mmc.c | 3 ++-

1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mmc/core/mmc.c +0 -0
index 65fe288..68c0e3b 100644
@@ -213,7 +213,8 @@ static int mmc_read_ext_csd(struct mmc_card *card)
		printk(KERN_ERR "%s: unrecognised EXT_CSD structure "
			"version %d\n", mmc_hostname(card->host),
			ext_csd_struct);
-		return -EINVAL;
+		err = -EINVAL;
+		goto out;
	}

	if (ext_csd_struct >= 2) {
#1 lore raw
Quoted 6 lines · On Sat, 13 Oct 2007 12:27:20 -0400 Florin Malita <[email protected]> wrote:

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

Coverity CID 1909.

Signed-off-by Florin Malita

Quite right. Applied.

Rgds

Signature · 5 lines
     -- Pierre Ossman

  Linux kernel, MMC maintainer        http://www.kernel.org
  PulseAudio, core developer          http://pulseaudio.org
  rdesktop, core developer          http://www.rdesktop.org