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 <mirsad.todorovac@alu.unizg.hr> Link: https://lore.kernel.org/linux-usb/24263902-c9b3-ce29-237b-1c3d6918f4fe@alu.unizg.hr Tested-by: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr> Fixes: 5c2a380 ("xhci: Allocate separate command structures for each LPM command") Cc: <Stable@vger.kernel.org> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20230330143056.1390020-4-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 8e77d3d commit f6caea4

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

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)