From d29a667c9f85043b8ca22966e2be2979f93c9a4c Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Tue, 15 May 2007 17:40:37 -0400 Subject: [PATCH] --- yaml --- r: 56838 b: refs/heads/master c: 57a21c1b929450b1e020c0a03cca6fa7448f4222 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/usb/core/config.c | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index cb0d262f1deb..41f4eb86ca6b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b89ee19ae6c0b5a0d9facca780b53959fbadd123 +refs/heads/master: 57a21c1b929450b1e020c0a03cca6fa7448f4222 diff --git a/trunk/drivers/usb/core/config.c b/trunk/drivers/usb/core/config.c index bfb3731d42db..2d4fd530e5e4 100644 --- a/trunk/drivers/usb/core/config.c +++ b/trunk/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;