Skip to contentSkip to conversation

Patchlet for drivers/usb/hub.c

PATCH Peter Zaitcev 1 participant 1 message Feb 28, 2001 USB

lore
Share & tools
lore
#0 lore raw
drivers/usb/hub.c +3 -3
@@ -150,14 +150,14 @@
 	unsigned int pipe;
 	int i, maxp, ret;
 
-	hub->descriptor = kmalloc(sizeof(hub->descriptor), GFP_KERNEL);
+	hub->descriptor = kmalloc(sizeof(*hub->descriptor), GFP_KERNEL);
 	if (!hub->descriptor) {
-		err("Unable to kmalloc %d bytes for hub descriptor", sizeof(hub->descriptor));
+		err("Unable to kmalloc %d bytes for hub descriptor", sizeof(*hub->descriptor));
 		return -1;
 	}
 
 	/* Request the entire hub descriptor. */
-	ret = usb_get_hub_descriptor(dev, hub->descriptor, sizeof(hub->descriptor));
+	ret = usb_get_hub_descriptor(dev, hub->descriptor, sizeof(*hub->descriptor));
 		/* <hub->descriptor> is large enough for a hub with 127 ports;
 		 * the hub can/will return fewer bytes here. */
 	if (ret < 0) {