aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/mgmt.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 54f3ddba9139..36b23101d651 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -1939,11 +1939,15 @@ static int pair_device(struct sock *sk, struct hci_dev *hdev, void *data,
1939 1939
1940 BT_DBG(""); 1940 BT_DBG("");
1941 1941
1942 memset(&rp, 0, sizeof(rp));
1943 bacpy(&rp.addr.bdaddr, &cp->addr.bdaddr);
1944 rp.addr.type = cp->addr.type;
1945
1942 hci_dev_lock(hdev); 1946 hci_dev_lock(hdev);
1943 1947
1944 if (!hdev_is_powered(hdev)) { 1948 if (!hdev_is_powered(hdev)) {
1945 err = cmd_status(sk, hdev->id, MGMT_OP_PAIR_DEVICE, 1949 err = cmd_complete(sk, hdev->id, MGMT_OP_PAIR_DEVICE,
1946 MGMT_STATUS_NOT_POWERED); 1950 MGMT_STATUS_NOT_POWERED, &rp, sizeof(rp));
1947 goto unlock; 1951 goto unlock;
1948 } 1952 }
1949 1953
@@ -1960,10 +1964,6 @@ static int pair_device(struct sock *sk, struct hci_dev *hdev, void *data,
1960 conn = hci_connect(hdev, LE_LINK, &cp->addr.bdaddr, 1964 conn = hci_connect(hdev, LE_LINK, &cp->addr.bdaddr,
1961 cp->addr.type, sec_level, auth_type); 1965 cp->addr.type, sec_level, auth_type);
1962 1966
1963 memset(&rp, 0, sizeof(rp));
1964 bacpy(&rp.addr.bdaddr, &cp->addr.bdaddr);
1965 rp.addr.type = cp->addr.type;
1966
1967 if (IS_ERR(conn)) { 1967 if (IS_ERR(conn)) {
1968 int status; 1968 int status;
1969 1969