Skip to contentSkip to conversation

mailbox: xgene-slimpro: Fix wrong test for devm_kzalloc

PATCH In review Axel Lin 1 participant 2 messages Mar 21, 2016 – Apr 7, 2016 Mailbox API

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 mailbox: xgene-slimpro: Fix wrong test for devm_kzalloc

devm_kzalloc() returns NULL on failure.

---
 drivers/mailbox/mailbox-xgene-slimpro.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mailbox/mailbox-xgene-slimpro.c +2 -2
index bd07f39..dd2afbc 100644
@@ -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);
 
Signature · 1 line
2.1.4
author
#1 lore raw

2016-03-21 20:12 GMT+08:00 Axel Lin <[email protected]>:

Quoted 1 line

devm_kzalloc() returns NULL on failure.

Hi,
I'm wondering if this trivial fix is lost.
Should I resend it?