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:
David Brownell 2007-02-15 18:52:30 -08:00 committed by Greg Kroah-Hartman
parent 6e91f527cd
commit cb1cebbee6

View File

@ -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);