public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Chen Ni <nichen@iscas.ac.cn>
Cc: rui.silva@linaro.org, gregkh@linuxfoundation.org, balbi@ti.com,
	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 11:35:50 +0200	[thread overview]
Message-ID: <20260210093550.GK2405149@killaraus.ideasonboard.com> (raw)
In-Reply-To: <20260210090202.2332349-1-nichen@iscas.ac.cn>

On Tue, Feb 10, 2026 at 05:02:02PM +0800, 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>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  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;
>  
>  	irq = platform_get_irq(pdev, 0);
>  	if (irq < 0)

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2026-02-10  9:35 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 [this message]
2026-02-10 13:45 ` Sergey Shtylyov
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=20260210093550.GK2405149@killaraus.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --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