aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb
diff options
context:
space:
mode:
authorH. Nikolaus Schaller <hns@goldelico.com>2013-08-26 18:51:18 +0200
committerH. Nikolaus Schaller <hns@goldelico.com>2013-08-26 18:51:18 +0200
commitd608319a5b5ba455dd75757b3123915cb837df0d (patch)
tree49439b6fd991d353a24db7f9ff3fa6c05d8b8d5a /drivers/net/usb
parentdb8ed0d584495a1354d2265bc3735faff2e8dfb7 (diff)
parentd8dfad3876e4386666b759da3c833d62fb8b2267 (diff)
downloadkernel_goldelico_gta04-d608319a5b5ba455dd75757b3123915cb837df0d.zip
kernel_goldelico_gta04-d608319a5b5ba455dd75757b3123915cb837df0d.tar.gz
kernel_goldelico_gta04-d608319a5b5ba455dd75757b3123915cb837df0d.tar.bz2
Merge commit 'd8dfad3876e4386666b759da3c833d62fb8b2267' into neil-3.1x-plus
Diffstat (limited to 'drivers/net/usb')
-rw-r--r--drivers/net/usb/hso.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index ea3c3c5..79a30b4 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -2818,13 +2818,16 @@ exit:
static int hso_get_config_data(struct usb_interface *interface)
{
struct usb_device *usbdev = interface_to_usbdev(interface);
- u8 config_data[17];
+ u8 *config_data = kmalloc(17, GFP_KERNEL);
u32 if_num = interface->altsetting->desc.bInterfaceNumber;
s32 result;
+ if (!config_data)
+ return -ENOMEM;
if (usb_control_msg(usbdev, usb_rcvctrlpipe(usbdev, 0),
0x86, 0xC0, 0, 0, config_data, 17,
USB_CTRL_SET_TIMEOUT) != 0x11) {
+ kfree(config_data);
return -EIO;
}
@@ -2875,6 +2878,7 @@ static int hso_get_config_data(struct usb_interface *interface)
if (config_data[16] & 0x1)
result |= HSO_INFO_CRC_BUG;
+ kfree(config_data);
return result;
}
@@ -2888,6 +2892,11 @@ static int hso_probe(struct usb_interface *interface,
struct hso_shared_int *shared_int;
struct hso_device *tmp_dev = NULL;
+ if (interface->cur_altsetting->desc.bInterfaceClass != 0xFF) {
+ dev_err(&interface->dev, "Not our interface\n");
+ return -ENODEV;
+ }
+
if_num = interface->altsetting->desc.bInterfaceNumber;
/* Get the interface/port specification from either driver_info or from
@@ -2897,10 +2906,6 @@ static int hso_probe(struct usb_interface *interface,
else
port_spec = hso_get_config_data(interface);
- if (interface->cur_altsetting->desc.bInterfaceClass != 0xFF) {
- dev_err(&interface->dev, "Not our interface\n");
- return -ENODEV;
- }
/* Check if we need to switch to alt interfaces prior to port
* configuration */
if (interface->num_altsetting > 1)