From: Sergey Shtylyov <sergei.shtylyov@gmail.com>
To: 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 16:45:45 +0300 [thread overview]
Message-ID: <3de6c9bd-35c5-45c5-874b-75c6623bd4ad@gmail.com> (raw)
In-Reply-To: <20260210090202.2332349-1-nichen@iscas.ac.cn>
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?
[...]
MBR, Sergey
next prev parent reply other threads:[~2026-02-10 13:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-10 9:02 Chen Ni
2026-02-10 9:35 ` Laurent Pinchart
2026-02-10 13:45 ` Sergey Shtylyov [this message]
2026-02-10 14:00 ` Rui Miguel Silva
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=3de6c9bd-35c5-45c5-874b-75c6623bd4ad@gmail.com \
--to=sergei.shtylyov@gmail.com \
--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=rui.silva@linaro.org \
/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
all inboxes | Powered by JetHome®