|
@@ -319,16 +319,18 @@ static int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id
|
|
|
struct usb_device *udev = interface_to_usbdev(intf);
|
|
|
struct wbsoft_priv *priv;
|
|
|
struct ieee80211_hw *dev;
|
|
|
- int err;
|
|
|
+ int nr, err;
|
|
|
|
|
|
usb_get_dev(udev);
|
|
|
|
|
|
// 20060630.2 Check the device if it already be opened
|
|
|
- err = usb_control_msg(udev, usb_rcvctrlpipe( udev, 0 ),
|
|
|
- 0x01, USB_TYPE_VENDOR|USB_RECIP_DEVICE|USB_DIR_IN,
|
|
|
- 0x0, 0x400, <mp, 4, HZ*100 );
|
|
|
- if (err)
|
|
|
+ nr = usb_control_msg(udev, usb_rcvctrlpipe( udev, 0 ),
|
|
|
+ 0x01, USB_TYPE_VENDOR|USB_RECIP_DEVICE|USB_DIR_IN,
|
|
|
+ 0x0, 0x400, <mp, 4, HZ*100 );
|
|
|
+ if (nr < 0) {
|
|
|
+ err = nr;
|
|
|
goto error;
|
|
|
+ }
|
|
|
|
|
|
ltmp = cpu_to_le32(ltmp);
|
|
|
if (ltmp) { // Is already initialized?
|
|
@@ -337,8 +339,10 @@ static int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id
|
|
|
}
|
|
|
|
|
|
dev = ieee80211_alloc_hw(sizeof(*priv), &wbsoft_ops);
|
|
|
- if (!dev)
|
|
|
+ if (!dev) {
|
|
|
+ err = -ENOMEM;
|
|
|
goto error;
|
|
|
+ }
|
|
|
|
|
|
priv = dev->priv;
|
|
|
|