linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mailbox: xgene-slimpro: Fix wrong test for devm_kzalloc
@ 2016-03-21 12:12 Axel Lin
  2016-04-07  6:22 ` Axel Lin
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2016-03-21 12:12 UTC (permalink / raw)
  To: Jassi Brar; +Cc: Feng Kan, Duc Dang, linux-kernel

devm_kzalloc() returns NULL on failure.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/mailbox/mailbox-xgene-slimpro.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mailbox/mailbox-xgene-slimpro.c b/drivers/mailbox/mailbox-xgene-slimpro.c
index bd07f39..dd2afbc 100644
--- a/drivers/mailbox/mailbox-xgene-slimpro.c
+++ b/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);
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mailbox: xgene-slimpro: Fix wrong test for devm_kzalloc
  2016-03-21 12:12 [PATCH] mailbox: xgene-slimpro: Fix wrong test for devm_kzalloc Axel Lin
@ 2016-04-07  6:22 ` Axel Lin
  0 siblings, 0 replies; 2+ messages in thread
From: Axel Lin @ 2016-04-07  6:22 UTC (permalink / raw)
  To: Jassi Brar; +Cc: Feng Kan, Duc Dang, linux-kernel

2016-03-21 20:12 GMT+08:00 Axel Lin <axel.lin@ingics.com>:
> devm_kzalloc() returns NULL on failure.

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-07  6:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-21 12:12 [PATCH] mailbox: xgene-slimpro: Fix wrong test for devm_kzalloc Axel Lin
2016-04-07  6:22 ` Axel Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).