[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1458562340.3929.0.camel@ingics.com>
Date: Mon, 21 Mar 2016 20:12:20 +0800
From: Axel Lin <axel.lin@...ics.com>
To: Jassi Brar <jassisinghbrar@...il.com>
Cc: Feng Kan <fkan@....com>, Duc Dang <dhdang@....com>,
linux-kernel@...r.kernel.org
Subject: [PATCH] mailbox: xgene-slimpro: Fix wrong test for devm_kzalloc
devm_kzalloc() returns NULL on failure.
Signed-off-by: Axel Lin <axel.lin@...ics.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
Powered by blists - more mailing lists