]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Bluetooth: qca: fix firmware check error path
authorJohan Hovold <johan+linaro@kernel.org>
Wed, 1 May 2024 06:37:40 +0000 (08:37 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 May 2024 09:56:23 +0000 (11:56 +0200)
commit064688d70c33bb5b49dde6e972b9379a8b045d8a
treede6e122cdc019854452c33d7311a20726cc9565e
parent57062aa13e87b1a78a4a8f6cb5fab6ba24f5f488
Bluetooth: qca: fix firmware check error path

commit 40d442f969fb1e871da6fca73d3f8aef1f888558 upstream.

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: f905ae0be4b7 ("Bluetooth: qca: add missing firmware sanity checks")
Cc: stable@vger.kernel.org # 4.19
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/bluetooth/btqca.c