- usb-dont-try-to-kzalloc-0-bytes.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     USB: don't try to kzalloc 0 bytes
has been removed from the -mm tree.  Its filename was
     usb-dont-try-to-kzalloc-0-bytes.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
Subject: USB: don't try to kzalloc 0 bytes
From: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>

This patch (as907) prevents us from trying to allocate 0 bytes
when an interface has no endpoint descriptors.

Signed-off-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
Cc: Greg KH <greg@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/usb/core/config.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff -puN drivers/usb/core/config.c~usb-dont-try-to-kzalloc-0-bytes drivers/usb/core/config.c
--- a/drivers/usb/core/config.c~usb-dont-try-to-kzalloc-0-bytes
+++ a/drivers/usb/core/config.c
@@ -185,10 +185,12 @@ static int usb_parse_interface(struct de
 		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;
_

Patches currently in -mm which might be from stern@xxxxxxxxxxxxxxxxxxx are

revert-gregkh-usb-usb-make-the-autosuspend-workqueue-thread-freezable.patch
fix-usb-ohci-subvendor-for-toshiba-portege-4000.patch
hisax-fix-error-checking-for-hisax_register.patch
usb-fix-suspend-to-ram.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux