summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/dw_mmc-pltfm.c
diff options
context:
space:
mode:
authorJames Hogan2012-10-16 10:43:08 +0200
committerChris Ball2012-11-07 20:55:31 +0100
commitcb27a843de9e3a0a2e4b7e631da4679d38f49cee (patch)
tree5b8ecf1db605f4a619c370521ae557d9d6a5ef68 /drivers/mmc/host/dw_mmc-pltfm.c
parentmmc: dw_mmc: enable controller interrupt before calling mmc_start_host (diff)
downloadkernel-qcow2-linux-cb27a843de9e3a0a2e4b7e631da4679d38f49cee.tar.gz
kernel-qcow2-linux-cb27a843de9e3a0a2e4b7e631da4679d38f49cee.tar.xz
kernel-qcow2-linux-cb27a843de9e3a0a2e4b7e631da4679d38f49cee.zip
mmc: dw_mmc: fix multiple drv_data NULL dereferences
800d78bfccb3d ("mmc: dw_mmc: add support for implementation specific callbacks") -- merged in v3.7-rc1 -- introduced multiple NULL pointer dereferences when the default dw_mci_pltfm_probe() is used, as it sets host->drv_data to NULL, and that's only checked against NULL in 1 out of the 7 cases where it is dereferenced. Signed-off-by: James Hogan <james.hogan@imgtec.com> Acked-by: Jaehoon Chung <jh80.chung@samsung.com> Acked-by: Will Newton <will.newton@imgtec.com> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host/dw_mmc-pltfm.c')
-rw-r--r--drivers/mmc/host/dw_mmc-pltfm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mmc/host/dw_mmc-pltfm.c b/drivers/mmc/host/dw_mmc-pltfm.c
index c960ca7ffbe6..e5957211b171 100644
--- a/drivers/mmc/host/dw_mmc-pltfm.c
+++ b/drivers/mmc/host/dw_mmc-pltfm.c
@@ -50,8 +50,8 @@ int dw_mci_pltfm_register(struct platform_device *pdev,
if (!host->regs)
return -ENOMEM;
- if (host->drv_data->init) {
- ret = host->drv_data->init(host);
+ if (drv_data && drv_data->init) {
+ ret = drv_data->init(host);
if (ret)
return ret;
}