Skip to content

Commit

Permalink
Bluetooth: Zero bredr pointer when chan is deleted
Browse files Browse the repository at this point in the history
If BREDR L2CAP chan is deleted and this chan is the channel through
which High Speed traffic is routed to AMP then zero pointer to
the chan in amp_mgr to prevent accessing it.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
  • Loading branch information
Andrei Emeltchenko authored and Gustavo Padovan committed Oct 15, 2012
1 parent 79de886 commit 56f6098
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions net/bluetooth/l2cap_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,7 @@ void l2cap_chan_del(struct l2cap_chan *chan, int err)
BT_DBG("chan %p, conn %p, err %d", chan, conn, err);

if (conn) {
struct amp_mgr *mgr = conn->hcon->amp_mgr;
/* Delete from channel list */
list_del(&chan->list);

Expand All @@ -540,6 +541,9 @@ void l2cap_chan_del(struct l2cap_chan *chan, int err)

if (chan->chan_type != L2CAP_CHAN_CONN_FIX_A2MP)
hci_conn_put(conn->hcon);

if (mgr && mgr->bredr_chan == chan)
mgr->bredr_chan = NULL;
}

chan->ops->teardown(chan, err);
Expand Down

0 comments on commit 56f6098

Please sign in to comment.