Skip to contentSkip to conversation

mailbox: mailbox-test: Fix an error check in mbox_test_probe()

PATCH New Minjie Du 1 participant 1 message Jul 13, 2023 Mailbox API

lore
Share & tools
lore

Minjie Du

author
#0 lore raw

PATCH 1/1 mailbox: mailbox-test: Fix an error check in mbox_test_probe()

mbox_test_request_channel() function returns NULL or error value embedded in the pointer (PTR_ERR). Evaluate the return value using IS_ERR_OR_NULL.

---
 drivers/mailbox/mailbox-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mailbox/mailbox-test.c +1 -1
index fc6a12a51..560c0fd98 100644
@@ -390,7 +390,7 @@ static int mbox_test_probe(struct platform_device *pdev)
 	tdev->tx_channel = mbox_test_request_channel(pdev, "tx");
 	tdev->rx_channel = mbox_test_request_channel(pdev, "rx");
 
-	if (!tdev->tx_channel && !tdev->rx_channel)
+	if (IS_ERR_OR_NULL(tdev->tx_channel) && IS_ERR_OR_NULL(tdev->rx_channel))
 		return -EPROBE_DEFER;
 
 	/* If Rx is not specified but has Rx MMIO, then Rx = Tx */
Signature · 1 line
2.39.0