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 4304f9519372d972c1d798a5c7a9aa33d3dce954..7e8a5a2e1ec7c210aaf2212d10b32905cebda72b 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);