Skip to content

Commit

Permalink
mailbox: mailbox-test: Fix an error check in mbox_test_probe()
Browse files Browse the repository at this point in the history
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 <duminjie@vivo.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
  • Loading branch information
Minjie Du authored and Jassi Brar committed Sep 5, 2023
1 parent fb5bda8 commit 9b63a81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mailbox/mailbox-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 9b63a81

Please sign in to comment.