]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
omap: hsmmc: Avoid NULL pointer dereference
authorFelipe Balbi <felipe.balbi@nokia.com>
Mon, 30 Jun 2008 14:16:27 +0000 (17:16 +0300)
committerTony Lindgren <tony@atomide.com>
Thu, 3 Jul 2008 10:21:35 +0000 (13:21 +0300)
Try if pdata provides a cleanup function pointers. For
boards which don't provide it, driver will oops in
omap_remove.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/mmc/host/omap_hsmmc.c

index 467f146fe799992d08283177953bcb7a01a08ea8..4dfa8ddeb0db52453c7cf837435aa0177f225a9c 100644 (file)
@@ -887,7 +887,8 @@ static int omap_mmc_remove(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, NULL);
        if (host) {
-               host->pdata->cleanup(&pdev->dev);
+               if (host->pdata->cleanup)
+                       host->pdata->cleanup(&pdev->dev);
                free_irq(host->irq, host);
                if (mmc_slot(host).card_detect_irq)
                        free_irq(mmc_slot(host).card_detect_irq, host);