diff options
author | Mathias Nyman <[email protected]> | 2023-03-30 17:30:56 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2023-03-30 16:42:17 +0200 |
commit | f6caea4855553a8b99ba3ec23ecdb5ed8262f26c (patch) | |
tree | e7af32cebf6d624a250fbf8423a6f5b39c7266d9 | |
parent | 8e77d3d59d7b5da13deda1d832c51b8bbdbe2037 (diff) |
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: 5c2a380a5aa8 ("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]>
-rw-r--r-- | drivers/usb/host/xhci.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index bdb6dd819a3b..6307bae9cddf 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -4442,6 +4442,7 @@ static int __maybe_unused xhci_change_max_exit_latency(struct xhci_hcd *xhci, if (!virt_dev || max_exit_latency == virt_dev->current_mel) { spin_unlock_irqrestore(&xhci->lock, flags); + xhci_free_command(xhci, command); return 0; } |