From: Yuanhan Liu Date: Wed, 8 Aug 2012 09:02:08 +0000 (+0800) Subject: ARM: mmp: fix potential NULL dereference X-Git-Tag: upstream/snapshot3+hdmi~6765^2~4^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c0db19dabf138741e078f6391fb132821c0d98b5;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git ARM: mmp: fix potential NULL dereference Fix the wrong logic: we should use || instead of && Cc: Leo Yan Cc: Eric Miao Signed-off-by: Yuanhan Liu Signed-off-by: Haojian Zhuang --- diff --git a/arch/arm/mach-mmp/sram.c b/arch/arm/mach-mmp/sram.c index 4304f95..7e8a5a2 100644 --- a/arch/arm/mach-mmp/sram.c +++ b/arch/arm/mach-mmp/sram.c @@ -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);