If the base address is not successfully obtained in the probe
function, then the mmc_host struct is not freed. Adding an exit for
that case fixes the bug.
Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
//BUG_ON((!hw) || (!mem) || (irq < 0)); /* --- by chhung */
base = devm_ioremap_resource(&pdev->dev, res);
- if (IS_ERR(base))
- return PTR_ERR(base);
+ if (IS_ERR(base)) {
+ ret = PTR_ERR(base);
+ goto host_free;
+ }
/* Set host parameters to mmc */
mmc->ops = &mt_msdc_ops;
if (mem)
release_mem_region(mem->start, mem->end - mem->start + 1);
+host_free:
mmc_free_host(mmc);
return ret;