mmc: omap_hsmmc: Prevent potential NULL dereference
Subsystems (2)
PATCH 1/1 mmc: omap_hsmmc: Prevent potential NULL dereference
of_get_hsmmc_pdata() may return NULL, thus ensure pdata is not NULL before dereference it.
Signed-off-by Axel Lin <[email protected]>
--- drivers/mmc/host/omap_hsmmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/omap_hsmmc.c +1 -1
@@ -1774,7 +1774,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev) match =of_match_device (of_match_ptr (omap_mmc_of_match), &pdev->dev);if (match) { pdata =of_get_hsmmc_pdata (&pdev->dev); -if (match->data) { +if (pdata && match->data) {const u16 *offsetp = match->data; pdata->reg_offset = *offsetp; }
Signature · 1 line
1.7.9.5