mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
mfd: asic3: Fix potential null pointer dereference
We previously assumed 'mem_sdio' could be null but it is dereferenced in ioremap(). Add a check to avoid a potential null pointer dereference error. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
This commit is contained in:
parent
967580598f
commit
44b61a9f23
@ -899,13 +899,15 @@ static int __init asic3_mfd_probe(struct platform_device *pdev,
|
|||||||
ds1wm_resources[0].end >>= asic->bus_shift;
|
ds1wm_resources[0].end >>= asic->bus_shift;
|
||||||
|
|
||||||
/* MMC */
|
/* MMC */
|
||||||
asic->tmio_cnf = ioremap((ASIC3_SD_CONFIG_BASE >> asic->bus_shift) +
|
if (mem_sdio) {
|
||||||
|
asic->tmio_cnf = ioremap((ASIC3_SD_CONFIG_BASE >> asic->bus_shift) +
|
||||||
mem_sdio->start,
|
mem_sdio->start,
|
||||||
ASIC3_SD_CONFIG_SIZE >> asic->bus_shift);
|
ASIC3_SD_CONFIG_SIZE >> asic->bus_shift);
|
||||||
if (!asic->tmio_cnf) {
|
if (!asic->tmio_cnf) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
dev_dbg(asic->dev, "Couldn't ioremap SD_CONFIG\n");
|
dev_dbg(asic->dev, "Couldn't ioremap SD_CONFIG\n");
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
asic3_mmc_resources[0].start >>= asic->bus_shift;
|
asic3_mmc_resources[0].start >>= asic->bus_shift;
|
||||||
asic3_mmc_resources[0].end >>= asic->bus_shift;
|
asic3_mmc_resources[0].end >>= asic->bus_shift;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user