From: Rui Miguel Silva <rui.silva@linaro.org>
To: "Sergey Shtylyov" <sergei.shtylyov@gmail.com>,
"Chen Ni" <nichen@iscas.ac.cn>, <rui.silva@linaro.org>,
<gregkh@linuxfoundation.org>, <laurent.pinchart@ideasonboard.com>,
<balbi@ti.com>
Cc: <linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] usb: isp1760: Add missing error check for platform_get_resource()
Date: Tue, 10 Feb 2026 14:00:09 +0000 [thread overview]
Message-ID: <DGBC3ZA7383J.2TB8U10NOWDLC@linaro.com> (raw)
In-Reply-To: <3de6c9bd-35c5-45c5-874b-75c6623bd4ad@gmail.com>
Hi,
On Tue Feb 10, 2026 at 1:45 PM WET, Sergey Shtylyov wrote:
> On 2/10/26 12:02 PM, Chen Ni wrote:
>
>> Check the return value of platform_get_resource() to prevent potential
>> NULL pointer dereference when the memory resource is unavailable.
>>
>> Fixes: 7ef077a8ad35 ("usb: isp1760: Move driver from drivers/usb/host/ to drivers/usb/isp1760/")
>> Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
>> ---
>> drivers/usb/isp1760/isp1760-if.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/usb/isp1760/isp1760-if.c b/drivers/usb/isp1760/isp1760-if.c
>> index a64190addba6..60f81ec81373 100644
>> --- a/drivers/usb/isp1760/isp1760-if.c
>> +++ b/drivers/usb/isp1760/isp1760-if.c
>> @@ -196,6 +196,8 @@ static int isp1760_plat_probe(struct platform_device *pdev)
>> int ret;
>>
>> mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> + if (!mem_res)
>> + return -EINVAL;
>
> Isn't it already checked in __devm_ioremap_resource(), called later on?
Yes, agree, I do not see where the pointer could be NULL dereferenced.
It is validated in devm_ioremap_resource, and the same error propagated.
Cheers,
Rui
>
> [...]
>
> MBR, Sergey
next prev parent reply other threads:[~2026-02-10 14:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-10 9:02 [PATCH] usb: isp1760: Add missing error check for platform_get_resource() Chen Ni
2026-02-10 9:35 ` Laurent Pinchart
2026-02-10 13:45 ` Sergey Shtylyov
2026-02-10 14:00 ` Rui Miguel Silva [this message]
2026-02-10 13:55 ` Sergey Shtylyov
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=DGBC3ZA7383J.2TB8U10NOWDLC@linaro.com \
--to=rui.silva@linaro.org \
--cc=balbi@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=nichen@iscas.ac.cn \
--cc=sergei.shtylyov@gmail.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