Skip to contentSkip to conversation

mmc: omap_hsmmc: Prevent potential NULL dereference

PATCH New Axel Lin 1 participant 1 message Mar 18, 2013

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

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.

---
 drivers/mmc/host/omap_hsmmc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/omap_hsmmc.c +1 -1
index bc58078..a8f9717 100644
@@ -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