Commit b699ec0d authored by Gustavo Padovan's avatar Gustavo Padovan

Bluetooth: Call ops->teardown() without checking for NULL

Users that don't implement teardown() should use l2cap_chan_no_teardown()
Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
parent d117773c
...@@ -542,7 +542,6 @@ void l2cap_chan_del(struct l2cap_chan *chan, int err) ...@@ -542,7 +542,6 @@ void l2cap_chan_del(struct l2cap_chan *chan, int err)
hci_conn_put(conn->hcon); hci_conn_put(conn->hcon);
} }
if (chan->ops->teardown)
chan->ops->teardown(chan, err); chan->ops->teardown(chan, err);
if (test_bit(CONF_NOT_COMPLETE, &chan->conf_state)) if (test_bit(CONF_NOT_COMPLETE, &chan->conf_state))
...@@ -582,7 +581,6 @@ void l2cap_chan_close(struct l2cap_chan *chan, int reason) ...@@ -582,7 +581,6 @@ void l2cap_chan_close(struct l2cap_chan *chan, int reason)
switch (chan->state) { switch (chan->state) {
case BT_LISTEN: case BT_LISTEN:
if (chan->ops->teardown)
chan->ops->teardown(chan, 0); chan->ops->teardown(chan, 0);
break; break;
...@@ -625,7 +623,6 @@ void l2cap_chan_close(struct l2cap_chan *chan, int reason) ...@@ -625,7 +623,6 @@ void l2cap_chan_close(struct l2cap_chan *chan, int reason)
break; break;
default: default:
if (chan->ops->teardown)
chan->ops->teardown(chan, 0); chan->ops->teardown(chan, 0);
break; break;
} }
......
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