mmc: possible leak in mmc_read_ext_csd
authorFlorin Malita <fmalita@gmail.com>
Sat, 13 Oct 2007 16:27:20 +0000 (12:27 -0400)
committerPierre Ossman <drzeus@drzeus.cx>
Wed, 17 Oct 2007 19:33:46 +0000 (21:33 +0200)
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>
drivers/mmc/core/mmc.c

index 65fe288..68c0e3b 100644 (file)
@@ -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) {