Commit cefd285a authored by Felipe Balbi's avatar Felipe Balbi Committed by Tony Lindgren

omap: hsmmc: Avoid NULL pointer dereference

Try if pdata provides a cleanup function pointers. For
boards which don't provide it, driver will oops in
omap_remove.
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent c052c19e
...@@ -887,7 +887,8 @@ static int omap_mmc_remove(struct platform_device *pdev) ...@@ -887,7 +887,8 @@ static int omap_mmc_remove(struct platform_device *pdev)
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
if (host) { if (host) {
host->pdata->cleanup(&pdev->dev); if (host->pdata->cleanup)
host->pdata->cleanup(&pdev->dev);
free_irq(host->irq, host); free_irq(host->irq, host);
if (mmc_slot(host).card_detect_irq) if (mmc_slot(host).card_detect_irq)
free_irq(mmc_slot(host).card_detect_irq, host); free_irq(mmc_slot(host).card_detect_irq, host);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment