summaryrefslogtreecommitdiff
path: root/drivers/staging/wlan-ng
diff options
context:
space:
mode:
authorEbru Akagunduz <ebru.akagunduz@gmail.com>2014-10-21 03:47:29 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-10-23 10:10:49 +0400
commitcb6c1ee3057ebb717fd4439711b3cb5354d5085f (patch)
tree4060bda0e0ba9396176c4dc9bb4b38dec2c1dec3 /drivers/staging/wlan-ng
parent1002a240ed72f0535f01ca88e0341ccf7c4e0b54 (diff)
downloadlinux-cb6c1ee3057ebb717fd4439711b3cb5354d5085f.tar.xz
staging: wlan-ng: Fix restricted __be16 degrades to integer
skb->protocol variable type is __be16 and in if condition it is comparing with ETH_P_80211_RAW constant variable which is not __be16 type. Using be16_to_cpu() function, value of skb->protocol converted native processor format. This bug was found by sparse. Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wlan-ng')
-rw-r--r--drivers/staging/wlan-ng/p80211netdev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c
index 2dd9bf8a6e18..a9c1e0bafa62 100644
--- a/drivers/staging/wlan-ng/p80211netdev.c
+++ b/drivers/staging/wlan-ng/p80211netdev.c
@@ -358,7 +358,7 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
* and return success .
* TODO: we need a saner way to handle this
*/
- if (skb->protocol != ETH_P_80211_RAW) {
+ if (be16_to_cpu(skb->protocol) != ETH_P_80211_RAW) {
netif_start_queue(wlandev->netdev);
netdev_notice(netdev, "Tx attempt prior to association, frame dropped.\n");
netdev->stats.tx_dropped++;
@@ -369,7 +369,7 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
}
/* Check for raw transmits */
- if (skb->protocol == ETH_P_80211_RAW) {
+ if (be16_to_cpu(skb->protocol) == ETH_P_80211_RAW) {
if (!capable(CAP_NET_ADMIN)) {
result = 1;
goto failed;