mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci-spear: fix possible null dereference
@ 2013-11-17 18:20 Geyslan G. Bem
  2013-11-18  4:23 ` Viresh Kumar
  0 siblings, 1 reply; 2+ messages in thread
From: Geyslan G. Bem @ 2013-11-17 18:20 UTC (permalink / raw)
  To: geyslan
  Cc: Viresh Kumar, Chris Ball, open list:SECURE DIGITAL HO...,
	open list:SECURE DIGITAL HO...,
	open list

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

Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
---
 drivers/mmc/host/sdhci-spear.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c
index 2dba9f8..c6e5d16 100644
--- a/drivers/mmc/host/sdhci-spear.c
+++ b/drivers/mmc/host/sdhci-spear.c
@@ -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
-- 
1.8.4.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] mmc: sdhci-spear: fix possible null dereference
  2013-11-17 18:20 [PATCH] mmc: sdhci-spear: fix possible null dereference Geyslan G. Bem
@ 2013-11-18  4:23 ` Viresh Kumar
  0 siblings, 0 replies; 2+ messages in thread
From: Viresh Kumar @ 2013-11-18  4:23 UTC (permalink / raw)
  To: Geyslan G. Bem
  Cc: Chris Ball, open list:SECURE DIGITAL HO...,
	open list:SECURE DIGITAL HO...,
	open list

On Sun, Nov 17, 2013 at 11:50 PM, Geyslan G. Bem <geyslan@gmail.com> wrote:
> Put the 'pdata->card_int_gpio' assignment in inner scope, avoiding
> explicit null dereference.
>
> Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
> ---
>  drivers/mmc/host/sdhci-spear.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

Thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-18  4:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-17 18:20 [PATCH] mmc: sdhci-spear: fix possible null dereference Geyslan G. Bem
2013-11-18  4:23 ` Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®