From: Alan Stern Date: Thu, 21 Jun 2007 20:26:46 +0000 (-0400) Subject: USB: Fix off-by-1 error in the scatter-gather library X-Git-Tag: v2.6.23-rc1~1083^2~28 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ccef0df54642f0f72f922d8aa57e8b290e31671;p=pandora-kernel.git USB: Fix off-by-1 error in the scatter-gather library The loop in usb_sg_wait() is structured in a way that makes it hard to tell, when the loop exits, whether or not the last URB submission succeeded. This patch (as928) changes it from a "for" loop to a "while" loop and keeps "i" always equal to the number of successful submissions. This fixes an off-by-one error which can show up when the first URB submission fails. The patch also removes a couple of lines that initialize fields which don't need to be initialized. Signed-off-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed