linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: omap_hsmmc: Prevent potential NULL dereference
@ 2013-03-18  9:34 Axel Lin
  0 siblings, 0 replies; only message in thread
From: Axel Lin @ 2013-03-18  9:34 UTC (permalink / raw)
  To: Chris Ball; +Cc: Balaji T K, linux-mmc, linux-omap

of_get_hsmmc_pdata() may return NULL, thus ensure pdata is not NULL
before dereference it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/mmc/host/omap_hsmmc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index bc58078..a8f9717 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -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;
 		}
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-03-18  9:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-18  9:34 [PATCH] mmc: omap_hsmmc: Prevent potential NULL dereference Axel Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).