Commit 995fca15 authored by Luiz Augusto von Dentz's avatar Luiz Augusto von Dentz Committed by Marcel Holtmann

Bluetooth: SMP: Fix crash when receiving new connection when debug is enabled

When receiving a new connection pchan->conn won't be initialized so the
code cannot use bt_dev_dbg as the pointer to hci_dev won't be
accessible.

Fixes: 2e1614f7 ("Bluetooth: SMP: Convert BT_ERR/BT_DBG to bt_dev_err/bt_dev_dbg")
Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent ad9d24c9
...@@ -3229,7 +3229,7 @@ static inline struct l2cap_chan *smp_new_conn_cb(struct l2cap_chan *pchan) ...@@ -3229,7 +3229,7 @@ static inline struct l2cap_chan *smp_new_conn_cb(struct l2cap_chan *pchan)
{ {
struct l2cap_chan *chan; struct l2cap_chan *chan;
bt_dev_dbg(pchan->conn->hcon->hdev, "pchan %p", pchan); BT_DBG("pchan %p", pchan);
chan = l2cap_chan_create(); chan = l2cap_chan_create();
if (!chan) if (!chan)
...@@ -3250,7 +3250,7 @@ static inline struct l2cap_chan *smp_new_conn_cb(struct l2cap_chan *pchan) ...@@ -3250,7 +3250,7 @@ static inline struct l2cap_chan *smp_new_conn_cb(struct l2cap_chan *pchan)
*/ */
atomic_set(&chan->nesting, L2CAP_NESTING_SMP); atomic_set(&chan->nesting, L2CAP_NESTING_SMP);
bt_dev_dbg(pchan->conn->hcon->hdev, "created chan %p", chan); BT_DBG("created chan %p", chan);
return chan; return chan;
} }
...@@ -3354,7 +3354,7 @@ static void smp_del_chan(struct l2cap_chan *chan) ...@@ -3354,7 +3354,7 @@ static void smp_del_chan(struct l2cap_chan *chan)
{ {
struct smp_dev *smp; struct smp_dev *smp;
bt_dev_dbg(chan->conn->hcon->hdev, "chan %p", chan); BT_DBG("chan %p", chan);
smp = chan->data; smp = chan->data;
if (smp) { if (smp) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment