mmc: sdhci-spear: fix possible null dereference
Subsystems (3)
PATCH 1/1 mmc: sdhci-spear: fix possible null dereference
Put the 'pdata->card_int_gpio' assignment in inner scope, avoiding explicit null dereference.
Signed-off-by Geyslan G. Bem <[email protected]>
--- drivers/mmc/host/sdhci-spear.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mmc/host/sdhci-spear.c +1 -2
@@ -88,10 +88,9 @@ static struct sdhci_plat_data *sdhci_probe_config_dt(struct platform_device *pdedev_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
Quoted 7 lines · Geyslan G. Bem
Put the '
pdata->card_int_gpio' assignment in inner scope, avoiding explicit null dereference.Signed-off-by Geyslan G. Bem <[email protected]>--- drivers/mmc/host/sdhci-spear.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Acked-by Viresh Kumar <[email protected]>
Thanks.