diff options
author | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-10-06 06:51:54 -0400 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-10-12 06:30:20 -0400 |
commit | b699ec0d99825713d30a057c432d0e29f07c5490 (patch) | |
tree | 6a5bfca888eee76982e0741c97544f01c932f748 /net/bluetooth | |
parent | d117773ce5c73eaa51f3283f89802f4491b27b2e (diff) |
Bluetooth: Call ops->teardown() without checking for NULL
Users that don't implement teardown() should use l2cap_chan_no_teardown()
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/l2cap_core.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 7c453d6f7354..2fb37dee7754 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -542,8 +542,7 @@ void l2cap_chan_del(struct l2cap_chan *chan, int err) | |||
542 | hci_conn_put(conn->hcon); | 542 | hci_conn_put(conn->hcon); |
543 | } | 543 | } |
544 | 544 | ||
545 | if (chan->ops->teardown) | 545 | chan->ops->teardown(chan, err); |
546 | chan->ops->teardown(chan, err); | ||
547 | 546 | ||
548 | if (test_bit(CONF_NOT_COMPLETE, &chan->conf_state)) | 547 | if (test_bit(CONF_NOT_COMPLETE, &chan->conf_state)) |
549 | return; | 548 | return; |
@@ -582,8 +581,7 @@ void l2cap_chan_close(struct l2cap_chan *chan, int reason) | |||
582 | 581 | ||
583 | switch (chan->state) { | 582 | switch (chan->state) { |
584 | case BT_LISTEN: | 583 | case BT_LISTEN: |
585 | if (chan->ops->teardown) | 584 | chan->ops->teardown(chan, 0); |
586 | chan->ops->teardown(chan, 0); | ||
587 | break; | 585 | break; |
588 | 586 | ||
589 | case BT_CONNECTED: | 587 | case BT_CONNECTED: |
@@ -625,8 +623,7 @@ void l2cap_chan_close(struct l2cap_chan *chan, int reason) | |||
625 | break; | 623 | break; |
626 | 624 | ||
627 | default: | 625 | default: |
628 | if (chan->ops->teardown) | 626 | chan->ops->teardown(chan, 0); |
629 | chan->ops->teardown(chan, 0); | ||
630 | break; | 627 | break; |
631 | } | 628 | } |
632 | } | 629 | } |