mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 18:09:56 +00:00
Bluetooth: msft: Fix memory leak
Fix leaking buffer allocated to send MSFT_OP_LE_MONITOR_ADVERTISEMENT.
Fixes: 9e14606d8f ("Bluetooth: msft: Extended monitor tracking by address filter")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
@@ -875,6 +875,7 @@ static int msft_add_address_filter_sync(struct hci_dev *hdev, void *data)
|
|||||||
remove = true;
|
remove = true;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
cp->sub_opcode = MSFT_OP_LE_MONITOR_ADVERTISEMENT;
|
cp->sub_opcode = MSFT_OP_LE_MONITOR_ADVERTISEMENT;
|
||||||
cp->rssi_high = address_filter->rssi_high;
|
cp->rssi_high = address_filter->rssi_high;
|
||||||
cp->rssi_low = address_filter->rssi_low;
|
cp->rssi_low = address_filter->rssi_low;
|
||||||
@@ -887,6 +888,8 @@ static int msft_add_address_filter_sync(struct hci_dev *hdev, void *data)
|
|||||||
|
|
||||||
skb = __hci_cmd_sync(hdev, hdev->msft_opcode, size, cp,
|
skb = __hci_cmd_sync(hdev, hdev->msft_opcode, size, cp,
|
||||||
HCI_CMD_TIMEOUT);
|
HCI_CMD_TIMEOUT);
|
||||||
|
kfree(cp);
|
||||||
|
|
||||||
if (IS_ERR(skb)) {
|
if (IS_ERR(skb)) {
|
||||||
bt_dev_err(hdev, "Failed to enable address %pMR filter",
|
bt_dev_err(hdev, "Failed to enable address %pMR filter",
|
||||||
&address_filter->bdaddr);
|
&address_filter->bdaddr);
|
||||||
|
|||||||
Reference in New Issue
Block a user