linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mailbox: mailbox-test: Fix a potential Oops on allocation failure
@ 2020-06-03 10:33 Dan Carpenter
  2020-06-04  7:41 ` Lee Jones
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2020-06-03 10:33 UTC (permalink / raw)
  To: Jassi Brar; +Cc: Lee Jones, linux-kernel, kernel-janitors

The callers are expecting NULL on error so if we return an error pointer
it eventually results in an Oops.

Fixes: 8ea4484d0c2b ("mailbox: Add generic mechanism for testing Mailbox Controllers")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/mailbox/mailbox-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mailbox/mailbox-test.c b/drivers/mailbox/mailbox-test.c
index 4555d678fadda..51640a7999e6b 100644
--- a/drivers/mailbox/mailbox-test.c
+++ b/drivers/mailbox/mailbox-test.c
@@ -327,7 +327,7 @@ mbox_test_request_channel(struct platform_device *pdev, const char *name)
 
 	client = devm_kzalloc(&pdev->dev, sizeof(*client), GFP_KERNEL);
 	if (!client)
-		return ERR_PTR(-ENOMEM);
+		return NULL;
 
 	client->dev		= &pdev->dev;
 	client->rx_callback	= mbox_test_receive_message;
-- 
2.26.2


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

* Re: [PATCH] mailbox: mailbox-test: Fix a potential Oops on allocation failure
  2020-06-03 10:33 [PATCH] mailbox: mailbox-test: Fix a potential Oops on allocation failure Dan Carpenter
@ 2020-06-04  7:41 ` Lee Jones
  0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2020-06-04  7:41 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Jassi Brar, linux-kernel, kernel-janitors

On Wed, 03 Jun 2020, Dan Carpenter wrote:

> The callers are expecting NULL on error so if we return an error pointer
> it eventually results in an Oops.
> 
> Fixes: 8ea4484d0c2b ("mailbox: Add generic mechanism for testing Mailbox Controllers")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/mailbox/mailbox-test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Lee Jones <lee.jones@linaro.org>

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

end of thread, other threads:[~2020-06-04  7:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-03 10:33 [PATCH] mailbox: mailbox-test: Fix a potential Oops on allocation failure Dan Carpenter
2020-06-04  7:41 ` Lee Jones

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).