Commit eaac6a2d authored by Chen Ni's avatar Chen Ni Committed by David S. Miller
Browse files

asix: Add check for usbnet_get_endpoints



Add check for usbnet_get_endpoints() and return the error if it fails
in order to transfer the error.

Fixes: 16626b0c ("asix: Add a new driver for the AX88172A")
Signed-off-by: default avatarChen Ni <nichen@iscas.ac.cn>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 818ed893
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -161,7 +161,9 @@ static int ax88172a_bind(struct usbnet *dev, struct usb_interface *intf)
	u8 buf[ETH_ALEN];
	struct ax88172a_private *priv;

	usbnet_get_endpoints(dev, intf);
	ret = usbnet_get_endpoints(dev, intf);
	if (ret)
		return ret;

	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
	if (!priv)