USB: pwc-if loop fix
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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
1f54a6ae79
commit
444f4f91fd
@@ -866,11 +866,10 @@ int pwc_isoc_init(struct pwc_device *pdev)
|
|||||||
}
|
}
|
||||||
if (ret) {
|
if (ret) {
|
||||||
/* De-allocate in reverse order */
|
/* De-allocate in reverse order */
|
||||||
while (i >= 0) {
|
while (i--) {
|
||||||
if (pdev->sbuf[i].urb != NULL)
|
if (pdev->sbuf[i].urb != NULL)
|
||||||
usb_free_urb(pdev->sbuf[i].urb);
|
usb_free_urb(pdev->sbuf[i].urb);
|
||||||
pdev->sbuf[i].urb = NULL;
|
pdev->sbuf[i].urb = NULL;
|
||||||
i--;
|
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user