aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc/phidgetkit.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-03-21 12:25:47 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-21 12:25:47 -0500
commit2bf2154c6bb5599e3ec3f73c34861a0b12aa839e (patch)
tree62691bd915e2e3c2e6648306d3fb893f7a1dc57e /drivers/usb/misc/phidgetkit.c
parent08a4ecee986dd98e86090ff5faac4782b6765aed (diff)
parent71a8924bee63d891f6256d560e32416a458440b3 (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: (81 commits) [PATCH] USB: omninet: fix up debugging comments [PATCH] USB serial: add navman driver [PATCH] USB: Fix irda-usb use after use [PATCH] USB: rtl8150 small fix [PATCH] USB: ftdi_sio: add Icom ID1 USB product and vendor ids [PATCH] USB: cp2101: add new device IDs [PATCH] USB: fix check_ctrlrecip to allow control transfers in state ADDRESS [PATCH] USB: vicam.c: fix a NULL pointer dereference [PATCH] USB: ZC0301 driver bugfix [PATCH] USB: add support for Creativelabs Silvercrest USB keyboard [PATCH] USB: storage: new unusual_devs.h entry: Mitsumi 7in1 Card Reader [PATCH] USB: storage: unusual_devs.h entry 0420:0001 [PATCH] USB: storage: another unusual_devs.h entry [PATCH] USB: storage: sandisk unusual_devices entry [PATCH] USB: fix initdata issue in isp116x-hcd [PATCH] USB: usbcore: usb_set_configuration oops (NULL ptr dereference) [PATCH] USB: usbcore: Don't assume a USB configuration includes any interfaces [PATCH] USB: ub 03 drop stall clearing [PATCH] USB: ub 02 remove diag [PATCH] USB: ub 01 remove first_open ...
Diffstat (limited to 'drivers/usb/misc/phidgetkit.c')
-rw-r--r--drivers/usb/misc/phidgetkit.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/usb/misc/phidgetkit.c b/drivers/usb/misc/phidgetkit.c
index 605a3c87e05c..997db5d8e35b 100644
--- a/drivers/usb/misc/phidgetkit.c
+++ b/drivers/usb/misc/phidgetkit.c
@@ -88,7 +88,7 @@ static int change_outputs(struct phidget_interfacekit *kit, int output_num, int
88 int retval; 88 int retval;
89 int n; 89 int n;
90 90
91 buffer = kmalloc(4, GFP_KERNEL); 91 buffer = kzalloc(4, GFP_KERNEL);
92 if (!buffer) { 92 if (!buffer) {
93 dev_err(&kit->udev->dev, "%s - out of memory\n", 93 dev_err(&kit->udev->dev, "%s - out of memory\n",
94 __FUNCTION__); 94 __FUNCTION__);
@@ -96,7 +96,6 @@ static int change_outputs(struct phidget_interfacekit *kit, int output_num, int
96 } 96 }
97 97
98 kit->outputs[output_num] = enable; 98 kit->outputs[output_num] = enable;
99 memset(buffer, 0, 4);
100 for (n=0; n<8; n++) { 99 for (n=0; n<8; n++) {
101 if (kit->outputs[n]) { 100 if (kit->outputs[n]) {
102 buffer[0] |= 1 << n; 101 buffer[0] |= 1 << n;
@@ -192,7 +191,7 @@ static ssize_t set_backlight(struct device *dev, struct device_attribute *attr,
192 unsigned char *buffer; 191 unsigned char *buffer;
193 int retval = -ENOMEM; 192 int retval = -ENOMEM;
194 193
195 buffer = kmalloc(8, GFP_KERNEL); 194 buffer = kzalloc(8, GFP_KERNEL);
196 if (!buffer) { 195 if (!buffer) {
197 dev_err(&kit->udev->dev, "%s - out of memory\n", __FUNCTION__); 196 dev_err(&kit->udev->dev, "%s - out of memory\n", __FUNCTION__);
198 goto exit; 197 goto exit;
@@ -202,7 +201,6 @@ static ssize_t set_backlight(struct device *dev, struct device_attribute *attr,
202 retval = -EINVAL; 201 retval = -EINVAL;
203 goto exit; 202 goto exit;
204 } 203 }
205 memset(buffer, 0x00, 8);
206 if (enabled) 204 if (enabled)
207 buffer[0] = 0x01; 205 buffer[0] = 0x01;
208 buffer[7] = 0x11; 206 buffer[7] = 0x11;
@@ -406,12 +404,11 @@ static int interfacekit_probe(struct usb_interface *intf, const struct usb_devic
406 pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress); 404 pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress);
407 maxp = usb_maxpacket(dev, pipe, usb_pipeout(pipe)); 405 maxp = usb_maxpacket(dev, pipe, usb_pipeout(pipe));
408 406
409 kit = kmalloc(sizeof(*kit), GFP_KERNEL); 407 kit = kzalloc(sizeof(*kit), GFP_KERNEL);
410 if (kit == NULL) { 408 if (kit == NULL) {
411 dev_err(&intf->dev, "%s - out of memory\n", __FUNCTION__); 409 dev_err(&intf->dev, "%s - out of memory\n", __FUNCTION__);
412 return -ENOMEM; 410 return -ENOMEM;
413 } 411 }
414 memset(kit, 0, sizeof(*kit));
415 kit->ifkit = ifkit; 412 kit->ifkit = ifkit;
416 413
417 kit->data = usb_buffer_alloc(dev, 8, SLAB_ATOMIC, &kit->data_dma); 414 kit->data = usb_buffer_alloc(dev, 8, SLAB_ATOMIC, &kit->data_dma);