]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
r8152: handle the return value of usb_reset_device()
authorChih Kai Hsu <hsu.chih.kai@realtek.com>
Thu, 4 Jun 2026 09:22:47 +0000 (17:22 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 9 Jun 2026 09:05:35 +0000 (11:05 +0200)
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 <hsu.chih.kai@realtek.com>
Reviewed-by: Hayes Wang <hayeswang@realtek.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20260604092247.27158-450-nic_swsd@realtek.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/usb/r8152.c

index 1ace1d2398c9c19b868282f2ff269060d9c983e6..b1268553cd7041c5e947832d4aaea1cfb665d793 100644 (file)
@@ -9851,7 +9851,12 @@ static int rtl8152_probe_once(struct usb_interface *intf,
        struct net_device *netdev;
        int ret;
 
-       usb_reset_device(udev);
+       ret = usb_reset_device(udev);
+       if (ret < 0) {
+               dev_err(&intf->dev, "USB reset failed, errno=%d\n", ret);
+               return ret;
+       }
+
        netdev = alloc_etherdev(sizeof(struct r8152));
        if (!netdev) {
                dev_err(&intf->dev, "Out of memory\n");