diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2023-03-17 17:47:06 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-23 17:25:22 +0100 |
commit | 76dc910af13c677b504ac8606352c791891166b1 (patch) | |
tree | 9c5bc1fc15d879577d9fed2c650e4a353652ff3d /drivers/usb/host | |
parent | 3056a5cafa3cf83c7c83d3fb4029707888d4bb63 (diff) | |
download | lwn-76dc910af13c677b504ac8606352c791891166b1.tar.gz lwn-76dc910af13c677b504ac8606352c791891166b1.zip |
xhci: mem: Use while (i--) pattern to clean up
Use more natural while (i--) patter to clean up allocated resources.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20230317154715.535523-6-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r-- | drivers/usb/host/xhci-mem.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index fa0c4ac2ca7f..b8c1465f8d23 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c @@ -1679,11 +1679,10 @@ static int scratchpad_alloc(struct xhci_hcd *xhci, gfp_t flags) return 0; fail_sp4: - for (i = i - 1; i >= 0; i--) { + while (i--) dma_free_coherent(dev, xhci->page_size, xhci->scratchpad->sp_buffers[i], xhci->scratchpad->sp_array[i]); - } kfree(xhci->scratchpad->sp_buffers); |