ARM: mmp: fix potential NULL dereference
authorYuanhan Liu <yliu.null@gmail.com>
Wed, 8 Aug 2012 09:02:08 +0000 (17:02 +0800)
committerHaojian Zhuang <haojian.zhuang@gmail.com>
Fri, 10 Aug 2012 14:32:24 +0000 (22:32 +0800)
Fix the wrong logic: we should use || instead of &&

Cc: Leo Yan <leoy@marvell.com>
Cc: Eric Miao <eric.y.miao@gmail.com>
Signed-off-by: Yuanhan Liu <yliu.null@gmail.com>
Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
arch/arm/mach-mmp/sram.c

index 4304f95..7e8a5a2 100644 (file)
@@ -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);