Skip to content

Commit 72da7b2

Browse files
josephsihholtmann
authored andcommitted
Bluetooth: mgmt: add mgmt_cmd_status in add_advertising
If an error occurs during request building in add_advertising(), remember to send MGMT_STATUS_FAILED command status back to bluetoothd. Signed-off-by: Joseph Hwang <[email protected]> Signed-off-by: Manish Mandlik <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent 8a59561 commit 72da7b2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

net/bluetooth/mgmt.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6807,8 +6807,11 @@ static int add_advertising(struct sock *sk, struct hci_dev *hdev,
68076807
if (!err)
68086808
err = hci_req_run(&req, add_advertising_complete);
68096809

6810-
if (err < 0)
6810+
if (err < 0) {
6811+
err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_ADD_ADVERTISING,
6812+
MGMT_STATUS_FAILED);
68116813
mgmt_pending_remove(cmd);
6814+
}
68126815

68136816
unlock:
68146817
hci_dev_unlock(hdev);

0 commit comments

Comments
 (0)