From nobody Mon Jun 8 09:50:05 2026 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (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 2038A3EBF15; Thu, 4 Jun 2026 09:23:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780565000; cv=none; b=mUubhVvDWaiJFildza63ZnQyxx+FZrnAn1DlOlZ1N+WI0/ObHVaJmGcjYj6H1gKITT+c7ZJuGb8v+8FqX5cc8uCpblq6mW8dH0HgKcFnpQLuXHsbrAUctTF2r/eXRANGTK+VstgvTy2Q7CjluJ6XtMSE3WoeNPvFnc+BzhGd0t0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780565000; c=relaxed/simple; bh=/6eKU1SpO8nE4h7gav7y5E+tojtp8nFQ5kNIDSmPLTo=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=OwuDSRQiRTzbXb7Ap+oUrpzO2QaMQA9Ofu7EUM32qVEMZXAMs+pWwM0zYX+JquEmT04Abftsy1kqrLSER1Y9U6YSw4MdKahAYne8uposXHGRgiYVa4rg5aYl8brS+8MLaLw+moJhO2ajxpzFGanLaFbHo8F0L5s4er53otjNPcA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; dkim=pass (2048-bit key) header.d=realtek.com header.i=@realtek.com header.b=U+MS47WC; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=realtek.com header.i=@realtek.com header.b="U+MS47WC" X-SpamFilter-By: ArmorX SpamTrap 5.80 with qID 6549N9hhC248473, This message is accepted by code: ctloc85258 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=realtek.com; s=dkim; t=1780564989; bh=YRHBswac5oyBqR78JunX1qdXAJ+4U1Q51+l/YUbtoek=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:Content-Type; b=U+MS47WCSjHt6uky9jL2L6S3e2mair1AhuGIsoJ5FoCsFZErSw0vNe94XlNS2JzrV 2/OW/svPpmR0B4ZxUaGO4/yeOYCgRk0socg6i5w3ttOKRxxOF6eh1swI9LoSvGdr2O S2mphcLRFQU04Cdd8Zw6beXx1RlKP6/SRAbp1aaeqzAzhsxOqFHD/+n0pYvfcm4bBD +HNy0PkctNdibcN3Fc90yx1L7h31HQWYt0HlMWYGhp24aBQLQ3ATKNukHZfrUJC2FY B0BrIz9jEXPgh7XpciXwAQMtZX7Za5Vi99YpW5OTRAEFf05b39JPJA3qW1AiX4Ml+z bbAMiCE3aTIeQ== Received: from mail.realtek.com (rtkexhmbs02.realtek.com.tw[172.21.6.41]) by rtits2.realtek.com.tw (8.15.2/3.28/5.94) with ESMTPS id 6549N9hhC248473 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 4 Jun 2026 17:23:09 +0800 Received: from RTKEXHMBS03.realtek.com.tw (10.21.1.53) by RTKEXHMBS02.realtek.com.tw (172.21.6.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Thu, 4 Jun 2026 17:23:09 +0800 Received: from fc40.realtek.com.tw (172.22.241.7) by RTKEXHMBS03.realtek.com.tw (10.21.1.53) with Microsoft SMTP Server id 15.2.2562.17 via Frontend Transport; Thu, 4 Jun 2026 17:23:09 +0800 From: Chih Kai Hsu To: , CC: , , , , Chih Kai Hsu Subject: [PATCH net] r8152: handle the return value of usb_reset_device() Date: Thu, 4 Jun 2026 17:22:47 +0800 Message-ID: <20260604092247.27158-450-nic_swsd@realtek.com> X-Mailer: git-send-email 2.53.0 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" If usb_reset_device() returns a negative error code, stop the process of probing. Fixes: 10c3271712f5 ("r8152: disable the ECM mode") Signed-off-by: Chih Kai Hsu Reviewed-by: Andrew Lunn Reviewed-by: Hayes Wang --- drivers/net/usb/r8152.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 1ace1d2398c9..b1268553cd70 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -9851,7 +9851,12 @@ static int rtl8152_probe_once(struct usb_interface *= intf, struct net_device *netdev; int ret; =20 - usb_reset_device(udev); + ret =3D usb_reset_device(udev); + if (ret < 0) { + dev_err(&intf->dev, "USB reset failed, errno=3D%d\n", ret); + return ret; + } + netdev =3D alloc_etherdev(sizeof(struct r8152)); if (!netdev) { dev_err(&intf->dev, "Out of memory\n"); --=20 2.34.1