summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2008-03-27 15:15:22 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2008-04-03 00:06:09 +0200
commit4756febb10d96104e08661031ba835771075419c (patch)
tree4fbcc68c889dee9c6f5812a9af35dc9985ac409b
parentUSB: serial: fix regression in Visor/Palm OS module for kernels >= 2.6.24 (diff)
downloadlinux-4756febb10d96104e08661031ba835771075419c.tar.xz
linux-4756febb10d96104e08661031ba835771075419c.zip
USB: fix bug in sg initialization in usbtest
This patch (as1062) fixes a bug in the scatter-gather initialization code in the usbtest driver. When the sg-helper conversion was performed, it wasn't done correctly. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/misc/usbtest.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
index da922dfc0dcc..b6b5b2affad1 100644
--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -378,6 +378,7 @@ alloc_sglist (int nents, int max, int vary)
sg = kmalloc (nents * sizeof *sg, GFP_KERNEL);
if (!sg)
return NULL;
+ sg_init_table(sg, nents);
for (i = 0; i < nents; i++) {
char *buf;
@@ -390,7 +391,7 @@ alloc_sglist (int nents, int max, int vary)
}
/* kmalloc pages are always physically contiguous! */
- sg_init_one(&sg[i], buf, size);
+ sg_set_buf(&sg[i], buf, size);
switch (pattern) {
case 0: