提交 c0521baf 编写于 作者: U Uwe Kleine-König 提交者: Linus Torvalds

mxcmmc: fix error path in mxcmci_probe

After a failing allocation of mmc or a failed ioremap in mxcmci_probe host was
used uninitialized.
Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: NSascha Hauer <s.hauer@pengutronix.de>
Cc: Pierre Ossman <pierre@ossman.eu>
Cc: Martin Fuzzey <mfuzzey@gmail.com>
Cc: Pierre Ossman <drzeus@drzeus.cx>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 9b6e3e42
......@@ -679,17 +679,17 @@ static int mxcmci_probe(struct platform_device *pdev)
{
struct mmc_host *mmc;
struct mxcmci_host *host = NULL;
struct resource *r;
struct resource *iores, *r;
int ret = 0, irq;
printk(KERN_INFO "i.MX SDHC driver\n");
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
irq = platform_get_irq(pdev, 0);
if (!r || irq < 0)
if (!iores || irq < 0)
return -EINVAL;
r = request_mem_region(r->start, resource_size(r), pdev->name);
r = request_mem_region(iores->start, resource_size(iores), pdev->name);
if (!r)
return -EBUSY;
......@@ -809,7 +809,7 @@ static int mxcmci_probe(struct platform_device *pdev)
out_free:
mmc_free_host(mmc);
out_release_mem:
release_mem_region(host->res->start, resource_size(host->res));
release_mem_region(iores->start, resource_size(iores));
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册