linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mailbox: bcm2835: Fix of_xlate return value
@ 2018-05-26 10:24 Stefan Wahren
  2018-05-30 19:23 ` Eric Anholt
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Wahren @ 2018-05-26 10:24 UTC (permalink / raw)
  To: Jassi Brar, Eric Anholt
  Cc: Florian Fainelli, Ray Jui, Scott Branden, Phil Elwell,
	bcm-kernel-feedback-list, linux-kernel, linux-rpi-kernel,
	Stefan Wahren

The bcm2835-mailbox returns NULL instead of an error pointer, which could
result in a NULL ptr dereference in mbox_request_channel. So fix this
by returning a proper error pointer.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Fixes: 0bae6af6d704 ("mailbox: Enable BCM2835 mailbox support")
---
 drivers/mailbox/bcm2835-mailbox.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mailbox/bcm2835-mailbox.c b/drivers/mailbox/bcm2835-mailbox.c
index cfb4b44..e92bbc5 100644
--- a/drivers/mailbox/bcm2835-mailbox.c
+++ b/drivers/mailbox/bcm2835-mailbox.c
@@ -134,7 +134,7 @@ static struct mbox_chan *bcm2835_mbox_index_xlate(struct mbox_controller *mbox,
 		    const struct of_phandle_args *sp)
 {
 	if (sp->args_count != 0)
-		return NULL;
+		return ERR_PTR(-EINVAL);
 
 	return &mbox->chans[0];
 }
-- 
2.7.4

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

* Re: [PATCH] mailbox: bcm2835: Fix of_xlate return value
  2018-05-26 10:24 [PATCH] mailbox: bcm2835: Fix of_xlate return value Stefan Wahren
@ 2018-05-30 19:23 ` Eric Anholt
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Anholt @ 2018-05-30 19:23 UTC (permalink / raw)
  To: Stefan Wahren, Jassi Brar
  Cc: Florian Fainelli, Ray Jui, Scott Branden, Phil Elwell,
	bcm-kernel-feedback-list, linux-kernel, linux-rpi-kernel,
	Stefan Wahren

[-- Attachment #1: Type: text/plain, Size: 403 bytes --]

Stefan Wahren <stefan.wahren@i2se.com> writes:

> The bcm2835-mailbox returns NULL instead of an error pointer, which could
> result in a NULL ptr dereference in mbox_request_channel. So fix this
> by returning a proper error pointer.
>
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> Fixes: 0bae6af6d704 ("mailbox: Enable BCM2835 mailbox support")

Reviewed-by: Eric Anholt <eric@anholt.net>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

end of thread, other threads:[~2018-05-30 19:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-26 10:24 [PATCH] mailbox: bcm2835: Fix of_xlate return value Stefan Wahren
2018-05-30 19:23 ` Eric Anholt

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