[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20221125072127.doikcyawtja7ul2l@vireshk-i7>
Date: Fri, 25 Nov 2022 12:51:27 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Yang Yingliang <yangyingliang@...wei.com>
Cc: Tushar.Khandelwal@....com, jassisinghbrar@...il.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mailbox: arm_mhuv2: Fix return value check in
mhuv2_probe()
On 25-11-22, 14:35, Yang Yingliang wrote:
> If devm_of_iomap() fails, it returns ERR_PTR() and never
> return NULL, so replace NULL pointer check with IS_ERR()
> to fix this problem.
>
> Fixes: 5a6338cce9f4 ("mailbox: arm_mhuv2: Add driver")
> Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
> ---
> drivers/mailbox/arm_mhuv2.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mailbox/arm_mhuv2.c b/drivers/mailbox/arm_mhuv2.c
> index a47aef8df52f..c6d4957c4da8 100644
> --- a/drivers/mailbox/arm_mhuv2.c
> +++ b/drivers/mailbox/arm_mhuv2.c
> @@ -1062,8 +1062,8 @@ static int mhuv2_probe(struct amba_device *adev, const struct amba_id *id)
> int ret = -EINVAL;
>
> reg = devm_of_iomap(dev, dev->of_node, 0, NULL);
> - if (!reg)
> - return -ENOMEM;
> + if (IS_ERR(reg))
> + return PTR_ERR(reg);
>
> mhu = devm_kzalloc(dev, sizeof(*mhu), GFP_KERNEL);
> if (!mhu)
Acked-by: Viresh Kumar <viresh.kumar@...aro.org>
--
viresh
Powered by blists - more mailing lists