From: Yuanhan Liu Date: Wed, 8 Aug 2012 09:02:08 +0000 (+0800) Subject: ARM: mmp: fix potential NULL dereference X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=c0db19dabf138741e078f6391fb132821c0d98b5;p=openwrt%2Fstaging%2Fblogic.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 4304f9519372..7e8a5a2e1ec7 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);