From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6CC072F24 for ; Wed, 12 Apr 2023 08:49:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7F22C433EF; Wed, 12 Apr 2023 08:49:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1681289342; bh=vVMujNle3lMqeU6dWkS8rSDZt+7+0BlHFempBIRKjQQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XWJ0HYaZKrUioi9jtfFhTroV2gEBcKXYqkE3iMmtxZNuLDN+DWJTPA67kcAZL0VeQ Xti5RvSr7UD5jwa87WlunrvnA3QXisS8rsjApb+RMESZ1RlVzzH8trG34j18+F0gkC Pi06YFjxAtNccO0GoGEB1Y7IQ+FQSYARuM1DKv5o= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mirsad Goran Todorovac , Stable@vger.kernel.org, Mathias Nyman Subject: [PATCH 6.2 063/173] xhci: Free the command allocated for setting LPM if we return early Date: Wed, 12 Apr 2023 10:33:09 +0200 Message-Id: <20230412082840.626982848@linuxfoundation.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230412082838.125271466@linuxfoundation.org> References: <20230412082838.125271466@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Mathias Nyman commit f6caea4855553a8b99ba3ec23ecdb5ed8262f26c upstream. 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 Link: https://lore.kernel.org/linux-usb/24263902-c9b3-ce29-237b-1c3d6918f4fe@alu.unizg.hr Tested-by: Mirsad Goran Todorovac Fixes: 5c2a380a5aa8 ("xhci: Allocate separate command structures for each LPM command") Cc: Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20230330143056.1390020-4-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -4406,6 +4406,7 @@ static int __maybe_unused xhci_change_ma if (!virt_dev || max_exit_latency == virt_dev->current_mel) { spin_unlock_irqrestore(&xhci->lock, flags); + xhci_free_command(xhci, command); return 0; }