Skip to content

Commit f6caea4

Browse files
matnymangregkh
authored andcommitted
xhci: Free the command allocated for setting LPM if we return early
The command allocated to set exit latency LPM values need to be freed in case the command is never queued. This would be the case if there is no change in exit latency values, or device is missing. Reported-by: Mirsad Goran Todorovac <[email protected]> Link: https://lore.kernel.org/linux-usb/[email protected] Tested-by: Mirsad Goran Todorovac <[email protected]> Fixes: 5c2a380 ("xhci: Allocate separate command structures for each LPM command") Cc: <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 8e77d3d commit f6caea4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/usb/host/xhci.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4442,6 +4442,7 @@ static int __maybe_unused xhci_change_max_exit_latency(struct xhci_hcd *xhci,
44424442

44434443
if (!virt_dev || max_exit_latency == virt_dev->current_mel) {
44444444
spin_unlock_irqrestore(&xhci->lock, flags);
4445+
xhci_free_command(xhci, command);
44454446
return 0;
44464447
}
44474448

0 commit comments

Comments
 (0)