From cefd285a57331a00a67b77d0ff463a7aaaf2e765 Mon Sep 17 00:00:00 2001 From: Felipe Balbi Date: Mon, 30 Jun 2008 17:16:27 +0300 Subject: [PATCH] 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: Felipe Balbi Signed-off-by: Tony Lindgren --- drivers/mmc/host/omap_hsmmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 467f146fe79..4dfa8ddeb0d 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -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); -- 2.41.0