mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-19 15:39:07 +00:00
usbnet: init fault (oops) cleanup, whitespace fixes
This cleans up some error handling paths in usbnet device probing; one of them could cause oopsing, e.g. with some RNDIS devices. It also removes some extraneous whitespace. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
6e91f527cd
commit
cb1cebbee6
@ -834,7 +834,7 @@ kevent (struct work_struct *work)
|
||||
}
|
||||
|
||||
if (test_bit (EVENT_LINK_RESET, &dev->flags)) {
|
||||
struct driver_info *info = dev->driver_info;
|
||||
struct driver_info *info = dev->driver_info;
|
||||
int retval = 0;
|
||||
|
||||
clear_bit (EVENT_LINK_RESET, &dev->flags);
|
||||
@ -1111,7 +1111,7 @@ int
|
||||
usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
|
||||
{
|
||||
struct usbnet *dev;
|
||||
struct net_device *net;
|
||||
struct net_device *net;
|
||||
struct usb_host_interface *interface;
|
||||
struct driver_info *info;
|
||||
struct usb_device *xdev;
|
||||
@ -1181,6 +1181,9 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
|
||||
// NOTE net->name still not usable ...
|
||||
if (info->bind) {
|
||||
status = info->bind (dev, udev);
|
||||
if (status < 0)
|
||||
goto out1;
|
||||
|
||||
// heuristic: "usb%d" for links we know are two-host,
|
||||
// else "eth%d" when there's reasonable doubt. userspace
|
||||
// can rename the link if it knows better.
|
||||
@ -1207,7 +1210,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
|
||||
if (status == 0 && dev->status)
|
||||
status = init_status (dev, udev);
|
||||
if (status < 0)
|
||||
goto out1;
|
||||
goto out3;
|
||||
|
||||
if (!dev->rx_urb_size)
|
||||
dev->rx_urb_size = dev->hard_mtu;
|
||||
@ -1286,7 +1289,7 @@ static int __init usbnet_init(void)
|
||||
< sizeof (struct skb_data));
|
||||
|
||||
random_ether_addr(node_id);
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
module_init(usbnet_init);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user