mailbox: xgene-slimpro: Fix wrong test for devm_kzalloc
authorAxel Lin <axel.lin@ingics.com>
Mon, 21 Mar 2016 12:12:20 +0000 (20:12 +0800)
committerJassi Brar <jaswinder.singh@linaro.org>
Fri, 8 Apr 2016 04:00:11 +0000 (09:30 +0530)
devm_kzalloc() returns NULL on failure.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
drivers/mailbox/mailbox-xgene-slimpro.c

index bd07f39..dd2afbc 100644 (file)
@@ -189,8 +189,8 @@ static int slimpro_mbox_probe(struct platform_device *pdev)
        int i;
 
        ctx = devm_kzalloc(&pdev->dev, sizeof(struct slimpro_mbox), GFP_KERNEL);
-       if (IS_ERR(ctx))
-               return PTR_ERR(ctx);
+       if (!ctx)
+               return -ENOMEM;
 
        platform_set_drvdata(pdev, ctx);