Skip to contentSkip to conversation

mmc: sdhci-spear: fix possible null dereference

PATCH In review Geyslan G. Bem 2 participants 2 messages Nov 17, 2013 – Nov 18, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: sdhci-spear: fix possible null dereference

Put the 'pdata->card_int_gpio' assignment in inner scope, avoiding explicit null dereference.

---
 drivers/mmc/host/sdhci-spear.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mmc/host/sdhci-spear.c +1 -2
index 2dba9f8..c6e5d16 100644
@@ -88,10 +88,9 @@ static struct sdhci_plat_data *sdhci_probe_config_dt(struct platform_device *pde
 			dev_err(&pdev->dev, "DT: kzalloc failed\n");
 			return ERR_PTR(-ENOMEM);
 		}
+		pdata->card_int_gpio = cd_gpio;
 	}
 
-	pdata->card_int_gpio = cd_gpio;
-
 	return pdata;
 }
 #else
Signature · 1 line
1.8.4.2