浏览代码

mailbox: xgene-slimpro: Fix wrong test for devm_kzalloc

devm_kzalloc() returns NULL on failure.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Axel Lin 9 年之前
父节点
当前提交
a61b37ead5
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      drivers/mailbox/mailbox-xgene-slimpro.c

+ 2 - 2
drivers/mailbox/mailbox-xgene-slimpro.c

@@ -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);