public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: qca: fix firmware check error path
@ 2024-05-01  6:37 Johan Hovold
  2024-05-03 17:00 ` patchwork-bot+bluetooth
  0 siblings, 1 reply; 2+ messages in thread
From: Johan Hovold @ 2024-05-01  6:37 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz
  Cc: linux-bluetooth, linux-kernel, Johan Hovold, stable

A recent commit fixed the code that parses the firmware files before
downloading them to the controller but introduced a memory leak in case
the sanity checks ever fail.

Make sure to free the firmware buffer before returning on errors.

Fixes: 6fb81c405bfa ("Bluetooth: qca: add missing firmware sanity checks")
Cc: stable@vger.kernel.org      # 4.19
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
 drivers/bluetooth/btqca.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Luiz,

Sorry for not catching this before posting v2.

Feel to free to squash this fix into commit 6fb81c405bfa ("Bluetooth:
qca: add missing firmware sanity checks") in the bluetooth-next branch
if you prefer.

Note that the commit id in the Fixes tag above won't match if you cherry
pick both commits to the fixes branch.

Johan


diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c
index 125f140e012a..59e384fa1a0c 100644
--- a/drivers/bluetooth/btqca.c
+++ b/drivers/bluetooth/btqca.c
@@ -676,7 +676,7 @@ static int qca_download_firmware(struct hci_dev *hdev,
 
 	ret = qca_tlv_check_data(hdev, config, data, size, soc_type);
 	if (ret)
-		return ret;
+		goto out;
 
 	segment = data;
 	remain = size;
-- 
2.43.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Bluetooth: qca: fix firmware check error path
  2024-05-01  6:37 [PATCH] Bluetooth: qca: fix firmware check error path Johan Hovold
@ 2024-05-03 17:00 ` patchwork-bot+bluetooth
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+bluetooth @ 2024-05-03 17:00 UTC (permalink / raw)
  To: Johan Hovold; +Cc: marcel, luiz.dentz, linux-bluetooth, linux-kernel, stable

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Wed,  1 May 2024 08:37:40 +0200 you wrote:
> A recent commit fixed the code that parses the firmware files before
> downloading them to the controller but introduced a memory leak in case
> the sanity checks ever fail.
> 
> Make sure to free the firmware buffer before returning on errors.
> 
> Fixes: 6fb81c405bfa ("Bluetooth: qca: add missing firmware sanity checks")
> Cc: stable@vger.kernel.org      # 4.19
> Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
> 
> [...]

Here is the summary with links:
  - Bluetooth: qca: fix firmware check error path
    https://git.kernel.org/bluetooth/bluetooth-next/c/8da121d4396b

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-05-03 17:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-01  6:37 [PATCH] Bluetooth: qca: fix firmware check error path Johan Hovold
2024-05-03 17:00 ` patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox