Re: [PATCH 3/3] xhci: Free the command allocated for setting LPM if we return early

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, Mathias!

On 30.3.2023. 16:30, Mathias Nyman wrote:
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@xxxxxxxxxxxx>
Link: https://lore.kernel.org/linux-usb/24263902-c9b3-ce29-237b-1c3d6918f4fe@xxxxxxxxxxxx
Tested-by: Mirsad Goran Todorovac <mirsad.todorovac@xxxxxxxxxxxx>
Fixes: 5c2a380a5aa8 ("xhci: Allocate separate command structures for each LPM command")
Cc: <Stable@xxxxxxxxxxxxxxx>
Signed-off-by: Mathias Nyman <mathias.nyman@xxxxxxxxxxxxxxx>
---
  drivers/usb/host/xhci.c | 1 +
  1 file changed, 1 insertion(+)

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;
  	}

There seems to be a problem with applying this patch with "git am", as it
gives the following:

commit ff9de97baa02cb9362b7cb81e95bc9be424cab89
Author: @ <@>
Date:   Mon Apr 3 08:42:33 2023 +0200

    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.

    Fixes: 5c2a380a5aa8 ("xhci: Allocate separate command structures for each LPM command")
    Cc: <Stable@xxxxxxxxxxxxxxx>
    Signed-off-by: Mathias Nyman <mathias.nyman@xxxxxxxxxxxxxxx>

Thank you.

Best regards,
Mirsad

--
Mirsad Todorovac
System engineer
Faculty of Graphic Arts | Academy of Fine Arts
University of Zagreb
Republic of Croatia, the European Union

Sistem inženjer
Grafički fakultet | Akademija likovnih umjetnosti
Sveučilište u Zagrebu




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux