[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <31e30a15-d48e-e900-2842-34f2b87c57a8@huawei.com>
Date: Sun, 9 Oct 2022 16:38:11 +0800
From: Yang Yingliang <yangyingliang@...wei.com>
To: <linux-kernel@...r.kernel.org>, <linux-remoteproc@...r.kernel.org>,
<agross@...nel.org>, <andersson@...nel.org>
CC: Mukesh Ojha <quic_mojha@...cinc.com>, <bjorn.andersson@...aro.org>
Subject: Re: [PATCH -next 1/3] remoteproc: qcom: wcss: check return value
after calling platform_get_resource_byname()
Hi,
Are these patches good for merge or any more suggestion ?
Thanks,
Yang
On 2022/8/26 13:33, Mukesh Ojha wrote:
>
>
> On 8/26/2022 7:15 AM, Yang Yingliang wrote:
>> If platform_get_resource_byname() fails, 'res' will be set to null
>> pointer,
>> it will cause null-ptr-deref when it used in devm_ioremap(), so we
>> need check
>> the return value.
>>
>> Fixes: 0af65b9b915e ("remoteproc: qcom: wcss: Add non pas wcss Q6
>> support for QCS404")
>> Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
>> ---
>> drivers/remoteproc/qcom_q6v5_wcss.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/remoteproc/qcom_q6v5_wcss.c
>> b/drivers/remoteproc/qcom_q6v5_wcss.c
>> index bb0947f7770e..017ee225dc32 100644
>> --- a/drivers/remoteproc/qcom_q6v5_wcss.c
>> +++ b/drivers/remoteproc/qcom_q6v5_wcss.c
>> @@ -827,6 +827,8 @@ static int q6v5_wcss_init_mmio(struct q6v5_wcss
>> *wcss,
>> int ret;
>> res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
>> "qdsp6");
>> + if (!res)
>> + return -EINVAL;
>
> LGTM.
>
> Reviewed-by:Mukesh Ojha <quic_mojha@...cinc.com>
>
> -Mukesh
>
>> wcss->reg_base = devm_ioremap(&pdev->dev, res->start,
>> resource_size(res));
>> if (!wcss->reg_base)
> .
Powered by blists - more mailing lists