]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
Bluetooth: btmtkuart: fix a memleak in mtk_hci_wmt_sync
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Wed, 22 Sep 2021 13:49:45 +0000 (21:49 +0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Thu, 13 Jan 2022 17:42:17 +0000 (18:42 +0100)
commitdb3d146e390a9d7d49be75efc21419e38b3feb1a
treedeaecbfb9823f595b21e6860be6c8029e193c0dd
parentf3423075229904864ea21204d0f0ae6e96ca8f88
Bluetooth: btmtkuart: fix a memleak in mtk_hci_wmt_sync

BugLink: https://bugs.launchpad.net/bugs/1953387
[ Upstream commit 3e5f2d90c28f9454e421108554707620bc23269d ]

bdev->evt_skb will get freed in the normal path and one error path
of mtk_hci_wmt_sync, while the other error paths do not free it,
which may cause a memleak. This bug is suggested by a static analysis
tool, please advise.

Fixes: e0b67035a90b ("Bluetooth: mediatek: update the common setup between MT7622 and other devices")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/bluetooth/btmtkuart.c