From: Minjie Du Date: Thu, 13 Jul 2023 10:18:08 +0000 (+0800) Subject: mailbox: mailbox-test: Fix an error check in mbox_test_probe() X-Git-Tag: v6.6.7~1966^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9b63a810c6f95b65b26772f388966b85315d759f;p=platform%2Fkernel%2Flinux-starfive.git 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. Signed-off-by: Minjie Du Signed-off-by: Jassi Brar --- diff --git a/drivers/mailbox/mailbox-test.c b/drivers/mailbox/mailbox-test.c index 91b68cb..22d6018 100644 --- a/drivers/mailbox/mailbox-test.c +++ b/drivers/mailbox/mailbox-test.c @@ -388,7 +388,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 */