summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@tieto.com>2014-10-13 11:43:54 +0200
committerMarcel Holtmann <marcel@holtmann.org>2014-10-25 07:56:24 +0200
commit15346a9c2875cae8e84c13196a2fc7428d9358d4 (patch)
tree8d0521bd915d2a658a3c5870a456ed64dbb2cc32
parentec511545ef791577ed9dd055e3b2d6d926b85daf (diff)
Bluetooth: Improve RFCOMM __test_pf macro robustness
Value returned by this macro might be used as bit value so it should return either 0 or 1 to avoid possible bugs (similar to NSC bug) when shifting it. Signed-off-by: Szymon Janc <szymon.janc@tieto.com> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
-rw-r--r--net/bluetooth/rfcomm/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
index d0bbc737f16..bce9c3d3932 100644
--- a/net/bluetooth/rfcomm/core.c
+++ b/net/bluetooth/rfcomm/core.c
@@ -79,7 +79,7 @@ static struct rfcomm_session *rfcomm_session_del(struct rfcomm_session *s);
#define __test_ea(b) ((b & 0x01))
#define __test_cr(b) (!!(b & 0x02))
-#define __test_pf(b) ((b & 0x10))
+#define __test_pf(b) (!!(b & 0x10))
#define __addr(cr, dlci) (((dlci & 0x3f) << 2) | (cr << 1) | 0x01)
#define __ctrl(type, pf) (((type & 0xef) | (pf << 4)))