diff options
author | Dan Carpenter <dan.carpenter@linaro.org> | 2024-11-30 11:07:39 +0100 |
---|---|---|
committer | Jassi Brar <jassisinghbrar@gmail.com> | 2025-01-18 23:04:04 +0100 |
commit | d0f98e14c010bcf27898b635a54c1994ac4110a8 (patch) | |
tree | e7557d2323015d1c07ab384a5715353d7a34fc28 /drivers/mailbox/mailbox-th1520.c | |
parent | Linux 6.13-rc7 (diff) | |
download | linux-d0f98e14c010bcf27898b635a54c1994ac4110a8.tar.xz linux-d0f98e14c010bcf27898b635a54c1994ac4110a8.zip |
mailbox: th1520: Fix a NULL vs IS_ERR() bug
The devm_ioremap() function doesn't return error pointers, it returns
NULL. Update the error checking to match.
Fixes: 5d4d263e1c6b ("mailbox: Introduce support for T-head TH1520 Mailbox driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Michal Wilczynski <m.wilczynski@samsung.com>
Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
Diffstat (limited to 'drivers/mailbox/mailbox-th1520.c')
-rw-r--r-- | drivers/mailbox/mailbox-th1520.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mailbox/mailbox-th1520.c b/drivers/mailbox/mailbox-th1520.c index 4e84640ac3b8..e16e7c85ee3c 100644 --- a/drivers/mailbox/mailbox-th1520.c +++ b/drivers/mailbox/mailbox-th1520.c @@ -387,8 +387,10 @@ static void __iomem *th1520_map_mmio(struct platform_device *pdev, mapped = devm_ioremap(&pdev->dev, res->start + offset, resource_size(res) - offset); - if (IS_ERR(mapped)) + if (!mapped) { dev_err(&pdev->dev, "Failed to map resource: %s\n", res_name); + return ERR_PTR(-ENOMEM); + } return mapped; } |