Skip to contentSkip to conversation

ARM: mmp: fix potential NULL dereference

PATCH New Yuanhan Liu 2 participants 2 messages Aug 8, 2012 – Aug 10, 2012

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

PATCH 1/1 ARM: mmp: fix potential NULL dereference

Fix the wrong logic: we should use || instead of &&

Cc Leo Yan <[email protected]>
Cc Haojian Zhuang <[email protected]>
Cc Eric Miao <[email protected]>
---
 arch/arm/mach-mmp/sram.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-mmp/sram.c +1 -1
index 4304f95..7e8a5a2 100644
@@ -68,7 +68,7 @@ static int __devinit sram_probe(struct platform_device *pdev)
 	struct resource *res;
 	int ret = 0;
 
-	if (!pdata && !pdata->pool_name)
+	if (!pdata || !pdata->pool_name)
 		return -ENODEV;
 
 	info = kzalloc(sizeof(*info), GFP_KERNEL);
Signature · 1 line
1.7.4.4