Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Bluetooth: msft: Fix memory leak

Fix leaking buffer allocated to send MSFT_OP_LE_MONITOR_ADVERTISEMENT.

Fixes: 9e14606d8f38 ("Bluetooth: msft: Extended monitor tracking by address filter")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

+3
+3
net/bluetooth/msft.c
··· 875 875 remove = true; 876 876 goto done; 877 877 } 878 + 878 879 cp->sub_opcode = MSFT_OP_LE_MONITOR_ADVERTISEMENT; 879 880 cp->rssi_high = address_filter->rssi_high; 880 881 cp->rssi_low = address_filter->rssi_low; ··· 888 887 889 888 skb = __hci_cmd_sync(hdev, hdev->msft_opcode, size, cp, 890 889 HCI_CMD_TIMEOUT); 890 + kfree(cp); 891 + 891 892 if (IS_ERR(skb)) { 892 893 bt_dev_err(hdev, "Failed to enable address %pMR filter", 893 894 &address_filter->bdaddr);