Re: [PATCH] usb: isp1760: Add missing error check for platform_get_resource()
From: Laurent Pinchart
Date: Tue Feb 10 2026 - 04:37:52 EST
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@xxxxxxxxxxx>
Reviewed-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
> ---
> 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