diff options
author | Karsten Keil <kkeil@linux-pingi.de> | 2012-07-12 18:59:46 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-18 12:40:54 -0400 |
commit | 2ae4605d738ede6d94a481a30972fadfdaf73549 (patch) | |
tree | 7b92b5c173d75ffa83be5e8e9a6ad391bcd23737 /drivers/isdn/hisax | |
parent | 5b999fd04af95e2cb624aaf6a7637561572b2d96 (diff) |
ISDN: Add check for usb_alloc_urb() result
usb_alloc_urb() return value needs to be checked to avoid
later NULL pointer access.
Reported by rucsoftsec@gmail.com via bugzilla.kernel.org #44601.
Signed-off-by: Karsten Keil <kkeil@linux-pingi.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/hisax')
-rw-r--r-- | drivers/isdn/hisax/hfc_usb.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/isdn/hisax/hfc_usb.c b/drivers/isdn/hisax/hfc_usb.c index 84f9c8103078..849a80752685 100644 --- a/drivers/isdn/hisax/hfc_usb.c +++ b/drivers/isdn/hisax/hfc_usb.c | |||
@@ -1483,13 +1483,21 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
1483 | usb_rcvctrlpipe(context->dev, 0); | 1483 | usb_rcvctrlpipe(context->dev, 0); |
1484 | context->ctrl_out_pipe = | 1484 | context->ctrl_out_pipe = |
1485 | usb_sndctrlpipe(context->dev, 0); | 1485 | usb_sndctrlpipe(context->dev, 0); |
1486 | |||
1487 | driver_info = (hfcsusb_vdata *) | ||
1488 | hfcusb_idtab[vend_idx].driver_info; | ||
1489 | |||
1486 | context->ctrl_urb = usb_alloc_urb(0, GFP_KERNEL); | 1490 | context->ctrl_urb = usb_alloc_urb(0, GFP_KERNEL); |
1487 | 1491 | ||
1488 | driver_info = | 1492 | if (!context->ctrl_urb) { |
1489 | (hfcsusb_vdata *) hfcusb_idtab[vend_idx]. | 1493 | pr_warn("%s: No memory for control urb\n", |
1490 | driver_info; | 1494 | driver_info->vend_name); |
1491 | printk(KERN_INFO "HFC-S USB: detected \"%s\"\n", | 1495 | kfree(context); |
1492 | driver_info->vend_name); | 1496 | return -ENOMEM; |
1497 | } | ||
1498 | |||
1499 | pr_info("HFC-S USB: detected \"%s\"\n", | ||
1500 | driver_info->vend_name); | ||
1493 | 1501 | ||
1494 | DBG(HFCUSB_DBG_INIT, | 1502 | DBG(HFCUSB_DBG_INIT, |
1495 | "HFC-S USB: Endpoint-Config: %s (if=%d alt=%d), E-Channel(%d)", | 1503 | "HFC-S USB: Endpoint-Config: %s (if=%d alt=%d), E-Channel(%d)", |