summaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorJoseph Hwang <josephsih@chromium.org>2020-03-10 17:31:50 +0100
committerMarcel Holtmann <marcel@holtmann.org>2020-03-11 15:33:56 +0100
commit72da7b2ccabd5fd93d6b8d0093936e980602652b (patch)
treea3b408ec4acc7d705726241c5271b6985c301c08 /net/bluetooth
parentBluetooth: fix off by one in err_data_reporting cmd masks. (diff)
downloadlinux-72da7b2ccabd5fd93d6b8d0093936e980602652b.tar.xz
linux-72da7b2ccabd5fd93d6b8d0093936e980602652b.zip
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 <josephsih@chromium.org> Signed-off-by: Manish Mandlik <mmandlik@google.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/mgmt.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 4da48618b271..b3a7f387da32 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -6807,8 +6807,11 @@ static int add_advertising(struct sock *sk, struct hci_dev *hdev,
if (!err)
err = hci_req_run(&req, add_advertising_complete);
- if (err < 0)
+ if (err < 0) {
+ err = mgmt_cmd_status(sk, hdev->id, MGMT_OP_ADD_ADVERTISING,
+ MGMT_STATUS_FAILED);
mgmt_pending_remove(cmd);
+ }
unlock:
hci_dev_unlock(hdev);