]> www.infradead.org Git - users/dwmw2/linux.git/commit
net: mac802154: comparision issue of type cast, finding by EXTRA_CFLAGS=-W
authorChen Gang <gang.chen@asianux.com>
Thu, 25 Apr 2013 00:49:55 +0000 (00:49 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 19 May 2013 18:38:33 +0000 (11:38 -0700)
commit0523cdce095dfa615f9c7308603bb11e99179e3c
tree91fe3c29c4971d3af72061b227d3e145feea41bc
parentce5cd52ae112a367ea9c38b1727d99349802a00d
net: mac802154: comparision issue of type cast, finding by EXTRA_CFLAGS=-W

[ Upstream commit 2c1bbbffa0b644fab4f91878cde0c2e8f52e2dcc ]

Change MAC802154_CHAN_NONE from ~(u8)0 to 0xff, or the comparison in
mac802154_wpan_xmit() for ``chan == MAC802154_CHAN_NONE'' will not
succeed.

This bug can be boiled down to ``u8 foo = 0xff; if (foo == ~(u8)0)
[...] else [...]'' where the condition will always take the else
branch.

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/mac802154/mac802154.h