aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorMichael Hund <mhund@ld-didactic.de>2005-07-29 15:17:20 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-29 16:12:53 -0400
commita6db592e1624bb7ec62cf56629c9556442169ac5 (patch)
treed9b6638f8999c6306d5eaad86f3cab5cf641a276 /drivers/usb
parent86d30741e480f40676c2173e1153368a4846da48 (diff)
[PATCH] USB: ldusb fixes
below you will find the forgotten kmalloc check (sorry). Signed-off-by: Michael Hund <mhund@ld-didactic.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/misc/ldusb.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/usb/misc/ldusb.c b/drivers/usb/misc/ldusb.c
index 66ec88354b93..ad17892aac9e 100644
--- a/drivers/usb/misc/ldusb.c
+++ b/drivers/usb/misc/ldusb.c
@@ -23,6 +23,7 @@
23 * 23 *
24 * V0.1 (mh) Initial version 24 * V0.1 (mh) Initial version
25 * V0.11 (mh) Added raw support for HID 1.0 devices (no interrupt out endpoint) 25 * V0.11 (mh) Added raw support for HID 1.0 devices (no interrupt out endpoint)
26 * V0.12 (mh) Added kmalloc check for string buffer
26 */ 27 */
27 28
28#include <linux/config.h> 29#include <linux/config.h>
@@ -84,7 +85,7 @@ static struct usb_device_id ld_usb_table [] = {
84 { } /* Terminating entry */ 85 { } /* Terminating entry */
85}; 86};
86MODULE_DEVICE_TABLE(usb, ld_usb_table); 87MODULE_DEVICE_TABLE(usb, ld_usb_table);
87MODULE_VERSION("V0.11"); 88MODULE_VERSION("V0.12");
88MODULE_AUTHOR("Michael Hund <mhund@ld-didactic.de>"); 89MODULE_AUTHOR("Michael Hund <mhund@ld-didactic.de>");
89MODULE_DESCRIPTION("LD USB Driver"); 90MODULE_DESCRIPTION("LD USB Driver");
90MODULE_LICENSE("GPL"); 91MODULE_LICENSE("GPL");
@@ -635,6 +636,10 @@ static int ld_usb_probe(struct usb_interface *intf, const struct usb_device_id *
635 (le16_to_cpu(udev->descriptor.idProduct) == USB_DEVICE_ID_COM3LAB)) && 636 (le16_to_cpu(udev->descriptor.idProduct) == USB_DEVICE_ID_COM3LAB)) &&
636 (le16_to_cpu(udev->descriptor.bcdDevice) <= 0x103)) { 637 (le16_to_cpu(udev->descriptor.bcdDevice) <= 0x103)) {
637 buffer = kmalloc(256, GFP_KERNEL); 638 buffer = kmalloc(256, GFP_KERNEL);
639 if (buffer == NULL) {
640 dev_err(&intf->dev, "Couldn't allocate string buffer\n");
641 goto error;
642 }
638 /* usb_string makes SETUP+STALL to leave always ControlReadLoop */ 643 /* usb_string makes SETUP+STALL to leave always ControlReadLoop */
639 usb_string(udev, 255, buffer, 256); 644 usb_string(udev, 255, buffer, 256);
640 kfree(buffer); 645 kfree(buffer);