diff options
-rw-r--r-- | net/bluetooth/smp.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index 8d618e4654a5..b8c31467a7ac 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c | |||
@@ -884,11 +884,17 @@ bool smp_sufficient_security(struct hci_conn *hcon, u8 sec_level) | |||
884 | int smp_conn_security(struct hci_conn *hcon, __u8 sec_level) | 884 | int smp_conn_security(struct hci_conn *hcon, __u8 sec_level) |
885 | { | 885 | { |
886 | struct l2cap_conn *conn = hcon->l2cap_data; | 886 | struct l2cap_conn *conn = hcon->l2cap_data; |
887 | struct smp_chan *smp = conn->smp_chan; | 887 | struct smp_chan *smp; |
888 | __u8 authreq; | 888 | __u8 authreq; |
889 | 889 | ||
890 | BT_DBG("conn %p hcon %p level 0x%2.2x", conn, hcon, sec_level); | 890 | BT_DBG("conn %p hcon %p level 0x%2.2x", conn, hcon, sec_level); |
891 | 891 | ||
892 | /* This may be NULL if there's an unexpected disconnection */ | ||
893 | if (!conn) | ||
894 | return 1; | ||
895 | |||
896 | smp = conn->smp_chan; | ||
897 | |||
892 | if (!test_bit(HCI_LE_ENABLED, &hcon->hdev->dev_flags)) | 898 | if (!test_bit(HCI_LE_ENABLED, &hcon->hdev->dev_flags)) |
893 | return 1; | 899 | return 1; |
894 | 900 | ||