diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-21 12:25:47 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-21 12:25:47 -0500 |
commit | 2bf2154c6bb5599e3ec3f73c34861a0b12aa839e (patch) | |
tree | 62691bd915e2e3c2e6648306d3fb893f7a1dc57e /drivers/usb/misc/usbtest.c | |
parent | 08a4ecee986dd98e86090ff5faac4782b6765aed (diff) | |
parent | 71a8924bee63d891f6256d560e32416a458440b3 (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/usbtest.c')
-rw-r--r-- | drivers/usb/misc/usbtest.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c index 84fa1728f052..9d59b901841c 100644 --- a/drivers/usb/misc/usbtest.c +++ b/drivers/usb/misc/usbtest.c | |||
@@ -382,12 +382,11 @@ alloc_sglist (int nents, int max, int vary) | |||
382 | for (i = 0; i < nents; i++) { | 382 | for (i = 0; i < nents; i++) { |
383 | char *buf; | 383 | char *buf; |
384 | 384 | ||
385 | buf = kmalloc (size, SLAB_KERNEL); | 385 | buf = kzalloc (size, SLAB_KERNEL); |
386 | if (!buf) { | 386 | if (!buf) { |
387 | free_sglist (sg, i); | 387 | free_sglist (sg, i); |
388 | return NULL; | 388 | return NULL; |
389 | } | 389 | } |
390 | memset (buf, 0, size); | ||
391 | 390 | ||
392 | /* kmalloc pages are always physically contiguous! */ | 391 | /* kmalloc pages are always physically contiguous! */ |
393 | sg_init_one(&sg[i], buf, size); | 392 | sg_init_one(&sg[i], buf, size); |
@@ -842,10 +841,9 @@ test_ctrl_queue (struct usbtest_dev *dev, struct usbtest_param *param) | |||
842 | * as with bulk/intr sglists, sglen is the queue depth; it also | 841 | * as with bulk/intr sglists, sglen is the queue depth; it also |
843 | * controls which subtests run (more tests than sglen) or rerun. | 842 | * controls which subtests run (more tests than sglen) or rerun. |
844 | */ | 843 | */ |
845 | urb = kmalloc (param->sglen * sizeof (struct urb *), SLAB_KERNEL); | 844 | urb = kcalloc(param->sglen, sizeof(struct urb *), SLAB_KERNEL); |
846 | if (!urb) | 845 | if (!urb) |
847 | return -ENOMEM; | 846 | return -ENOMEM; |
848 | memset (urb, 0, param->sglen * sizeof (struct urb *)); | ||
849 | for (i = 0; i < param->sglen; i++) { | 847 | for (i = 0; i < param->sglen; i++) { |
850 | int pipe = usb_rcvctrlpipe (udev, 0); | 848 | int pipe = usb_rcvctrlpipe (udev, 0); |
851 | unsigned len; | 849 | unsigned len; |
@@ -1865,10 +1863,9 @@ usbtest_probe (struct usb_interface *intf, const struct usb_device_id *id) | |||
1865 | } | 1863 | } |
1866 | #endif | 1864 | #endif |
1867 | 1865 | ||
1868 | dev = kmalloc (sizeof *dev, SLAB_KERNEL); | 1866 | dev = kzalloc(sizeof(*dev), SLAB_KERNEL); |
1869 | if (!dev) | 1867 | if (!dev) |
1870 | return -ENOMEM; | 1868 | return -ENOMEM; |
1871 | memset (dev, 0, sizeof *dev); | ||
1872 | info = (struct usbtest_info *) id->driver_info; | 1869 | info = (struct usbtest_info *) id->driver_info; |
1873 | dev->info = info; | 1870 | dev->info = info; |
1874 | init_MUTEX (&dev->sem); | 1871 | init_MUTEX (&dev->sem); |