diff options
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/core/message.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index a73e08fdab36..fd4c36ea5e46 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c | |||
@@ -416,8 +416,11 @@ int usb_sg_init(struct usb_sg_request *io, struct usb_device *dev, | |||
416 | /* A length of zero means transfer the whole sg list */ | 416 | /* A length of zero means transfer the whole sg list */ |
417 | len = length; | 417 | len = length; |
418 | if (len == 0) { | 418 | if (len == 0) { |
419 | for_each_sg(sg, sg, nents, i) | 419 | struct scatterlist *sg2; |
420 | len += sg->length; | 420 | int j; |
421 | |||
422 | for_each_sg(sg, sg2, nents, j) | ||
423 | len += sg2->length; | ||
421 | } | 424 | } |
422 | } else { | 425 | } else { |
423 | /* | 426 | /* |