Bluetooth: hci_conn: Fix memory leaks
authorZhengchao Shao <shaozhengchao@huawei.com>
Wed, 4 Jan 2023 06:46:23 +0000 (14:46 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Feb 2023 07:34:21 +0000 (08:34 +0100)
commitf51a825b9f730a782aa768454906b4468e67b667
treefda297e0e6e43e0bcc4d626d30d41ad07c2564c5
parented818fd8c531abf561b379995ee7cc4c68029464
Bluetooth: hci_conn: Fix memory leaks

[ Upstream commit 3aa21311f36d8a2730c7ccef37235e951f23927b ]

When hci_cmd_sync_queue() failed in hci_le_terminate_big() or
hci_le_big_terminate(), the memory pointed by variable d is not freed,
which will cause memory leak. Add release process to error path.

Fixes: eca0ae4aea66 ("Bluetooth: Add initial implementation of BIS connections")
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/bluetooth/hci_conn.c