mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 04:42:04 -04:00
net: usb: asix_devices: Check return value of usbnet_get_endpoints
commit dc89548c6926d68dfdda11bebc1a5258bc41d887 upstream.
The code did not check the return value of usbnet_get_endpoints.
Add checks and return the error if it fails to transfer the error.
Found via static anlaysis and this is similar to
commit 07161b2416f7 ("sr9800: Add check for usbnet_get_endpoints").
Fixes: 933a27d39e ("USB: asix - Add AX88178 support and many other changes")
Fixes: 2e55cc7210 ("[PATCH] USB: usbnet (3/9) module for ASIX Ethernet adapters")
Cc: stable@vger.kernel.org
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://patch.msgid.link/20251026164318.57624-1-linmq006@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
7ad8aa6635
commit
ff4b007e55
1 changed files with 9 additions and 3 deletions
|
|
@ -230,7 +230,9 @@ static int ax88172_bind(struct usbnet *dev, struct usb_interface *intf)
|
|||
int i;
|
||||
unsigned long gpio_bits = dev->driver_info->data;
|
||||
|
||||
usbnet_get_endpoints(dev,intf);
|
||||
ret = usbnet_get_endpoints(dev, intf);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
/* Toggle the GPIOs in a manufacturer/model specific way */
|
||||
for (i = 2; i >= 0; i--) {
|
||||
|
|
@ -681,7 +683,9 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
|
|||
u32 phyid;
|
||||
struct asix_common_private *priv;
|
||||
|
||||
usbnet_get_endpoints(dev, intf);
|
||||
ret = usbnet_get_endpoints(dev, intf);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Maybe the boot loader passed the MAC address via device tree */
|
||||
if (!eth_platform_get_mac_address(&dev->udev->dev, buf)) {
|
||||
|
|
@ -1063,7 +1067,9 @@ static int ax88178_bind(struct usbnet *dev, struct usb_interface *intf)
|
|||
int ret;
|
||||
u8 buf[ETH_ALEN] = {0};
|
||||
|
||||
usbnet_get_endpoints(dev,intf);
|
||||
ret = usbnet_get_endpoints(dev, intf);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Get the MAC address */
|
||||
ret = asix_read_cmd(dev, AX_CMD_READ_NODE_ID, 0, 0, ETH_ALEN, buf, 0);
|
||||
|
|
|
|||
Loading…
Reference in a new issue