aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/core/config.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-23 08:12:54 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-23 08:12:54 -0700
commit641e22e04c48af5d813f119c55336e02a22756f5 (patch)
tree9f7f693e8dd030e1d28585893e6e53bd86b1208c /drivers/usb/core/config.c
parent31f6e1bd3b58c9a67e5ea0c2d372fbf5fc9e326d (diff)
parentfa91d43b914b77637653d984416e17e182f7b807 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6: (29 commits) USB: Add support for Olimex arm-usb-ocd JTAG interface serial port USB: Add support for Sierra Wireless Aircard 595U USB: ldusb bugfix USB: ftdi_sio: Add USB Product Id for OpenDCC USB: fix ratelimit call semantics USB: handle errors in power/level attribute USB: make the autosuspend workqueue thread freezable USB: Fix USB OHCI Subvendor for Toshiba Portege 4000 USB: usblp: Use correct DMA address in case of probe error USB: Fix debug output of ark3116 USB: Onetouch - switch to using input_dev->dev.parent USB: don't try to kzalloc 0 bytes USB: remove short initial timeout for device descriptor fetch USB: Deref URB after usbmon is done with it USB: Remove duplicate IDs from option card driver USB: auerswald: fix file release handler USB: fsl_usb2_udc: Fix UMTI_WIDE support and a compile warning USB: set the correct Interrupt interval in usb_bulk_msg USB: New device PID for ftdi_sio driver USB: remove unneeded WARN_ON ...
Diffstat (limited to 'drivers/usb/core/config.c')
-rw-r--r--drivers/usb/core/config.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index bfb3731d42db..2d4fd530e5e4 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -185,10 +185,12 @@ static int usb_parse_interface(struct device *ddev, int cfgno,
num_ep = USB_MAXENDPOINTS;
}
- len = sizeof(struct usb_host_endpoint) * num_ep;
- alt->endpoint = kzalloc(len, GFP_KERNEL);
- if (!alt->endpoint)
- return -ENOMEM;
+ if (num_ep > 0) { /* Can't allocate 0 bytes */
+ len = sizeof(struct usb_host_endpoint) * num_ep;
+ alt->endpoint = kzalloc(len, GFP_KERNEL);
+ if (!alt->endpoint)
+ return -ENOMEM;
+ }
/* Parse all the endpoint descriptors */
n = 0;