Skip to content

Commit

Permalink
ARM: mmp: fix potential NULL dereference
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yuanhan Liu authored and Haojian Zhuang committed Aug 10, 2012
1 parent 0d7614f commit c0db19d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm/mach-mmp/sram.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c0db19d

Please sign in to comment.