Re: [PATCH v2] SDIO driver for Marvell SoCs

From: Andrew Morton
Date: Thu Feb 19 2009 - 17:58:55 EST


On Thu, 19 Feb 2009 17:14:11 -0500 (EST)
Nicolas Pitre <nico@xxxxxxx> wrote:

> This supports MMC/SD/SDIO currently found on the Kirkwood 88F6281 and
> 88F6192 SoC controllers.

--- a/drivers/mmc/host/mvsdio.c~sdio-driver-for-marvell-socs-update
+++ a/drivers/mmc/host/mvsdio.c
@@ -783,9 +783,9 @@ out:
gpio_free(host->gpio_write_protect);
if (host->base)
iounmap(host->base);
- if (host->res)
- release_resource(host->res);
}
+ if (r)
+ release_resource(host->res);
if (mmc)
mmc_free_host(mmc);

_

Nope, this will deref a null pointer on that error path and wouldn't
release the right thing anyway.

Something like this...

--- a/drivers/mmc/host/mvsdio.c~sdio-driver-for-marvell-socs-update
+++ a/drivers/mmc/host/mvsdio.c
@@ -688,6 +688,7 @@ static int __init mvsd_probe(struct plat

mmc = mmc_alloc_host(sizeof(struct mvsd_host), &pdev->dev);
if (!mmc) {
+ release_resource(r);
ret = -ENOMEM;
goto out;
}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/