Linux Remote Processor Subsystem development
 help / color / mirror / Atom feed
From: Yang Yingliang <yangyingliang@huawei.com>
To: <linux-kernel@vger.kernel.org>,
	<linux-remoteproc@vger.kernel.org>, <agross@kernel.org>,
	<andersson@kernel.org>
Cc: Mukesh Ojha <quic_mojha@quicinc.com>, <bjorn.andersson@linaro.org>
Subject: Re: [PATCH -next 1/3] remoteproc: qcom: wcss: check return value after calling platform_get_resource_byname()
Date: Sun, 9 Oct 2022 16:38:11 +0800	[thread overview]
Message-ID: <31e30a15-d48e-e900-2842-34f2b87c57a8@huawei.com> (raw)
In-Reply-To: <63f86e67-23ce-0c53-e2dd-d7937584508b@quicinc.com>

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@huawei.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@quicinc.com>
>
> -Mukesh
>
>>       wcss->reg_base = devm_ioremap(&pdev->dev, res->start,
>>                         resource_size(res));
>>       if (!wcss->reg_base)
> .

      reply	other threads:[~2022-10-09  8:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-26  1:45 [PATCH -next 1/3] remoteproc: qcom: wcss: check return value after calling platform_get_resource_byname() Yang Yingliang
2022-08-26  1:45 ` [PATCH -next 2/3] remoteproc: qcom: wcss: Use devm_platform_ioremap_resource_byname() Yang Yingliang
2022-08-26  5:36   ` Mukesh Ojha
2022-08-26  1:45 ` [PATCH -next 3/3] remoteproc: qcom: wcss: Use dev_err_probe() helper in q6v5_wcss_init_clock() Yang Yingliang
2022-08-26  5:44   ` Mukesh Ojha
2022-08-26  5:33 ` [PATCH -next 1/3] remoteproc: qcom: wcss: check return value after calling platform_get_resource_byname() Mukesh Ojha
2022-10-09  8:38   ` Yang Yingliang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=31e30a15-d48e-e900-2842-34f2b87c57a8@huawei.com \
    --to=yangyingliang@huawei.com \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=quic_mojha@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox