diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2008-03-27 10:15:22 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-04-02 18:06:09 -0400 |
commit | 4756febb10d96104e08661031ba835771075419c (patch) | |
tree | 4fbcc68c889dee9c6f5812a9af35dc9985ac409b /drivers | |
parent | d04863e9e65767feff7807c8f693ac2719dd1944 (diff) |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/misc/usbtest.c | 3 |
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) | |||
378 | sg = kmalloc (nents * sizeof *sg, GFP_KERNEL); | 378 | sg = kmalloc (nents * sizeof *sg, GFP_KERNEL); |
379 | if (!sg) | 379 | if (!sg) |
380 | return NULL; | 380 | return NULL; |
381 | sg_init_table(sg, nents); | ||
381 | 382 | ||
382 | for (i = 0; i < nents; i++) { | 383 | for (i = 0; i < nents; i++) { |
383 | char *buf; | 384 | char *buf; |
@@ -390,7 +391,7 @@ alloc_sglist (int nents, int max, int vary) | |||
390 | } | 391 | } |
391 | 392 | ||
392 | /* kmalloc pages are always physically contiguous! */ | 393 | /* kmalloc pages are always physically contiguous! */ |
393 | sg_init_one(&sg[i], buf, size); | 394 | sg_set_buf(&sg[i], buf, size); |
394 | 395 | ||
395 | switch (pattern) { | 396 | switch (pattern) { |
396 | case 0: | 397 | case 0: |