Message ID | 20200218190509.Bluez.v1.1.I04681c6e295c27088c0b4ed7bb9b187d1bb4ed19@changeid |
---|---|
State | New |
Headers | show |
Series | [Bluez,v1] bluetooth: fix passkey uninitialized when used | expand |
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index 50e0ac692ec4..fa40de69e487 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c @@ -2179,10 +2179,12 @@ static u8 smp_cmd_pairing_random(struct l2cap_conn *conn, struct sk_buff *skb) */ if (hci_find_ltk(hcon->hdev, &hcon->dst, hcon->dst_type, hcon->role)) { + /* Set passkey to 0. The value can be any number since + * it'll be ignored anyway. + */ err = mgmt_user_confirm_request(hcon->hdev, &hcon->dst, hcon->type, - hcon->dst_type, - passkey, 1); + hcon->dst_type, 0, 1); if (err) return SMP_UNSPECIFIED; set_bit(SMP_FLAG_WAIT_USER, &smp->flags);