Bluetooth: btintel: Fix missing free skb in btintel_setup_combined()
authorWang ShaoBo <bobo.shaobowang@huawei.com>
Mon, 5 Dec 2022 13:53:57 +0000 (21:53 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:14:20 +0000 (13:14 +0100)
commite52b7d460a30506680ec57c28e88ce446ce590bf
treea0e74a48653d1fbaf31f32f7a7a98f76c45fc1f0
parentf7c9de3bcfcd9d2f62b1469431195dd5cdf43849
Bluetooth: btintel: Fix missing free skb in btintel_setup_combined()

[ Upstream commit cee50ce899de415baf4da3ed38b7d4f13c3170d1 ]

skb allocated by __hci_cmd_sync would not be used whether in checking
for supported iBT hardware variants or after, we should free it in all
error branches, this patch makes the case read version failed or default
error case free skb before return.

Fixes: c86c7285bb08 ("Bluetooth: btintel: Fix the legacy bootloader returns tlv based version")
Fixes: 019a1caa7fd2 ("Bluetooth: btintel: Refactoring setup routine for bootloader devices")
Signed-off-by: Wang ShaoBo <bobo.shaobowang@huawei.com>
Reviewed-by: Tedd Ho-Jeong An <tedd.an@intel.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/bluetooth/btintel.c