Skip to contentSkip to conversation

mailbox: imx: Fix return in imx_mu_scu_xlate()

PATCH New Dan Carpenter 1 participant 1 message Apr 7, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mailbox: imx: Fix return in imx_mu_scu_xlate()

This called from mbox_request_channel(). The caller is expecting error pointers and not NULL so this "return NULL;" will lead to an Oops.

Fixes 0a67003b1985 ("mailbox: imx: add SCU MU support")
---
 drivers/mailbox/imx-mailbox.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mailbox/imx-mailbox.c +1 -1
index 7906624a731c..9d6f0217077b 100644
@@ -374,7 +374,7 @@ static struct mbox_chan *imx_mu_scu_xlate(struct mbox_controller *mbox,
 		break;
 	default:
 		dev_err(mbox->dev, "Invalid chan type: %d\n", type);
-		return NULL;
+		return ERR_PTR(-EINVAL);
 	}
 
 	if (chan >= mbox->num_chans) {
Signature · 1 line
2.25.1