]> git.baikalelectronics.ru Git - kernel.git/commit
Bluetooth: hci_sync: fix memory leak in hci_update_adv_data()
authorZhengchao Shao <shaozhengchao@huawei.com>
Mon, 9 Jan 2023 01:26:51 +0000 (09:26 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Feb 2023 07:34:22 +0000 (08:34 +0100)
commitd294b45b7daa5f7dcb46dc299e4e21cb36532636
tree2ceb9ef914773af6f6c0e8e087358315025cdba2
parent223cc0330f34a4db81d9a3460230481c14aab6be
Bluetooth: hci_sync: fix memory leak in hci_update_adv_data()

[ Upstream commit 1ed8b37cbaf14574c779064ef1372af62e8ba6aa ]

When hci_cmd_sync_queue() failed in hci_update_adv_data(), inst_ptr is
not freed, which will cause memory leak, convert to use ERR_PTR/PTR_ERR
to pass the instance to callback so no memory needs to be allocated.

Fixes: 38aae3a05989 ("Bluetooth: convert hci_update_adv_data to hci_sync")
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_sync.c