From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D2FDF3624D9 for ; Tue, 10 Feb 2026 14:00:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770732019; cv=none; b=YmbtGfsX+A+klMbkLFr9Tm3DIeoEwWwBGrbxe5ErJdA87sgeYWW0pbhl2MG7jaTnicWeFFPi/G0fRh7sjV7Y/UQxY/V2QMtWv/gkxwh5D046pnXz3KCbJciT1+ufLV60AFjDGJOgtcpOnbQaNW/Gn41yYASLU2ZhmNExpJEy4PQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770732019; c=relaxed/simple; bh=9YVnIyIWorlkLNmu3if4AqK1cGIDJD0hTwMmr/tPHYI=; h=From:Mime-Version:Content-Type:Date:Message-Id:To:Cc:Subject: References:In-Reply-To; b=rzKZigKnXfoyHbxrlZNetN/VVxCfbxdnW7bFU//UkNpiX/LenuHS9BTbwIZhsJWOj2a0qS4SoxFBky+RDUxoAAaOwhB50gGQ9y1M77JxNYdpnfM8L8h4VYM70SXJ35Unn9mtgKD9ykqpW7F7knh8uAMlmkTHJvn56zjGXItVvr0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=oeSTjS2a; arc=none smtp.client-ip=209.85.221.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="oeSTjS2a" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-43767807cf3so1804722f8f.1 for ; Tue, 10 Feb 2026 06:00:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1770732016; x=1771336816; darn=vger.kernel.org; h=in-reply-to:references:subject:cc:to:message-id:date :content-transfer-encoding:mime-version:from:from:to:cc:subject:date :message-id:reply-to; bh=i0sgEyOu249wzRAgKIdHovRcnXREE7u8QYuPNkclj6s=; b=oeSTjS2a6bwkshkHzpvX3vYEjVg1ti041j/CoUajFczUbjGT3F36GPOeSUey2aQhGf 5dN7Z4FTE7sylUhnGquq8+gSrJSHdeWsZzV0MLkWTq8VF68LWiBQMxFZGhhs1NQYUsfu KecqGxud5jClIi3RKyRNQzFG/cDko9zW6V87M3JqMWYa31lvHPgna36fApC8hrgVUmEU buZsd4zVHbi/CpCp9/cLXiK+pDtAD2RiersOc+YmBdqagjbkI91raXiwK+KfV415npgc 9pWyPuqJyFQkWcaO12LuG5eqWE/U8JHMKhvTPb1I76poJvydAaA9v6pOViSNplF6XCLo CdUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770732016; x=1771336816; h=in-reply-to:references:subject:cc:to:message-id:date :content-transfer-encoding:mime-version:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=i0sgEyOu249wzRAgKIdHovRcnXREE7u8QYuPNkclj6s=; b=mr0L+LMCkk3XdyUq3WQoqeSRJszkEF1x13BhHRP4JztW6MSNZ04uXJKKS8y/tthxgo Q7l8A6eXH04ZlkFY3VpEfMTGnn8v68HxoRgYV76WuwZtoBylY0k9sIPjxDj/PVFiwbxB K6dJCVz2267kiGFuBk0YmzgKdvWxMHsNjUqwpTKYgt5DZpESST4gyUSdHKkuwfFWJLJ5 N+zQEjdnqNbkxKbC9VZrnsg/HGtMIIV91UMcAY3z/LUZhfoZooXbFVn9U+0CkO33EEs2 qtPW52eJvsYMRQRFbT/ikDARDJ/t3711SYpLcSmbYcZUNqRc3NDXNIfzoIL+p/lg+S+S MBFg== X-Forwarded-Encrypted: i=1; AJvYcCUNL6MrydL8TsxZ/RUMqo+Xan0F8u559nvmce0kTDLITihGZmfhyKNknr24201+3192JZeAFZaTydPHfHU=@vger.kernel.org X-Gm-Message-State: AOJu0YxQFaDxASni/Qrauhzd8nU35DPh9e708tymcro53u0epOuVy+ZK zStQOZigtqKl46dDzoI5mgyCtbtabU7MbeDInknlxW8mDQLFd3DSoYiTPI0/THDT7bs= X-Gm-Gg: AZuq6aLGux2VGKNAmMZZbFRcgC6vA4WKO+GvtwPN8An9+exqqe2FpRn4FCEdRa3BflI yU3hH3eP4PvXUU/QJKbMp8J8OeRAGEgfrMnnU7oea2qVY3IZEQrtU1iyw6CT1KyXyjWYl1PVRqz 1nP2gQFIfL8C6MBOUVkB6fEToHWiximKWC6L56jK87h3etun9a1OIYP9+/yGcTdcdhfZqia6AJn RV4cFzYmfyVbFYR2nlJqplophuYsBi9cOH9F8NOs/URGeVtTQqvSS2YfyRghWml1huyk5Rfbuir at0hbRg/jlvcy7sKfaGS3Z5AzReoWt1etX6Ghdpfxn+49KGuPBw7SmYKZuYCpIJy4smZTBjc0p/ 0SzGr1tEdx+YhCmmT6qHdZG4VKPsbHSlfRXh1HtHX7YdovIwaCqVGPnLJXiwUB2Ehs8Uqwl5XDO 296WsmMwlWCW0/nIiysd/8cIFUmkUgLFzszpD5yC+l+4XAk5XQCyCxP/ouRmjMQQ== X-Received: by 2002:a05:6000:24c8:b0:435:e448:2ce5 with SMTP id ffacd0b85a97d-436293bac76mr23981062f8f.48.1770732015914; Tue, 10 Feb 2026 06:00:15 -0800 (PST) Received: from localhost (a109-49-32-132.cpe.netcabo.pt. [109.49.32.132]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43629754c62sm31766664f8f.38.2026.02.10.06.00.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Feb 2026 06:00:15 -0800 (PST) From: Rui Miguel Silva X-Google-Original-From: "Rui Miguel Silva" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 10 Feb 2026 14:00:09 +0000 Message-Id: To: "Sergey Shtylyov" , "Chen Ni" , , , , Cc: , Subject: Re: [PATCH] usb: isp1760: Add missing error check for platform_get_resource() References: <20260210090202.2332349-1-nichen@iscas.ac.cn> <3de6c9bd-35c5-45c5-874b-75c6623bd4ad@gmail.com> 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. >>=20 >> Fixes: 7ef077a8ad35 ("usb: isp1760: Move driver from drivers/usb/host/ t= o drivers/usb/isp1760/") >> Signed-off-by: Chen Ni >> --- >> drivers/usb/isp1760/isp1760-if.c | 2 ++ >> 1 file changed, 2 insertions(+) >>=20 >> diff --git a/drivers/usb/isp1760/isp1760-if.c b/drivers/usb/isp1760/isp1= 760-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; >> =20 >> mem_res =3D 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