From: Andrei Emeltchenko Date: Wed, 11 Jul 2012 11:43:34 +0000 (+0300) Subject: Bluetooth: debug: Print l2cap_chan refcount X-Git-Tag: v3.6-rc1~125^2~57^2~2^2~21 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=4b10b274e22ca6df1cda2fccf3870b8586feec15;p=~emulex%2Finfiniband.git Bluetooth: debug: Print l2cap_chan refcount Improve debug output. Signed-off-by: Andrei Emeltchenko Signed-off-by: Gustavo Padovan --- diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index d80e3f0691b..e5164ff55f2 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h @@ -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); }