Commit 8e1350d5 authored by 倪琛's avatar 倪琛 Committed by sanglipeng1
Browse files

asix: Add check for usbnet_get_endpoints

stable inclusion
from stable-v5.10.208
commit cfbf618e9a21b5d418d4b0c2b18473dcce8e5f01
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I9T22K

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=cfbf618e9a21b5d418d4b0c2b18473dcce8e5f01



--------------------------------

[ Upstream commit eaac6a2d26b65511e164772bec6918fcbc61938e ]

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>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng1 <sanglipeng1@jd.com>
parent ce4a75c8
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -175,7 +175,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)