Skip to content

Commit

Permalink
USB: pwc-if loop fix
Browse files Browse the repository at this point in the history
We should free urbs starting at [i-1] not [i].

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Mariusz Kozlowski authored and Greg Kroah-Hartman committed Dec 1, 2006
1 parent 1f54a6a commit 444f4f9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/media/video/pwc/pwc-if.c
Original file line number Diff line number Diff line change
Expand Up @@ -866,11 +866,10 @@ int pwc_isoc_init(struct pwc_device *pdev)
}
if (ret) {
/* De-allocate in reverse order */
while (i >= 0) {
while (i--) {
if (pdev->sbuf[i].urb != NULL)
usb_free_urb(pdev->sbuf[i].urb);
pdev->sbuf[i].urb = NULL;
i--;
}
return ret;
}
Expand Down

0 comments on commit 444f4f9

Please sign in to comment.