Skip to content

Commit

Permalink
Bluetooth: debug: Print l2cap_chan refcount
Browse files Browse the repository at this point in the history
Improve debug output.

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 Jul 11, 2012
1 parent 9f1db00 commit 4b10b27
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/net/bluetooth/l2cap.h
Original file line number Diff line number Diff line change
Expand Up @@ -672,11 +672,15 @@ enum {

static inline void l2cap_chan_hold(struct l2cap_chan *c)
{
BT_DBG("chan %p orig refcnt %d", c, atomic_read(&c->refcnt));

atomic_inc(&c->refcnt);
}

static inline void l2cap_chan_put(struct l2cap_chan *c)
{
BT_DBG("chan %p orig refcnt %d", c, atomic_read(&c->refcnt));

if (atomic_dec_and_test(&c->refcnt))
kfree(c);
}
Expand Down

0 comments on commit 4b10b27

Please sign in to comment.