From: Yuanhan Liu Date: Wed, 8 Aug 2012 09:02:08 +0000 (+0800) Subject: ARM: mmp: fix potential NULL dereference X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c0db19dabf138741e078f6391fb132821c0d98b5;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.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 4304f951937..7e8a5a2e1ec 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);