aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-07-13 04:57:36 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-07-17 15:11:31 -0400
commit1924b4e294df4e97ad22557700e554af409569bc (patch)
tree46869522ffaede7244c7b9f30f730072a34d1c4f
parent00267d591b18fb550f0d63dba28daadf69f924fc (diff)
b43: use temporary rate_index for error checking
The mac80211 rate_index changed to be a u8, so can't hold the negative error value properly. Use a temporary variable for error checking. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/b43/xmit.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/wireless/b43/xmit.c b/drivers/net/wireless/b43/xmit.c
index b31ccc02fa21..136510edf3cf 100644
--- a/drivers/net/wireless/b43/xmit.c
+++ b/drivers/net/wireless/b43/xmit.c
@@ -663,7 +663,7 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr)
663 u32 uninitialized_var(macstat); 663 u32 uninitialized_var(macstat);
664 u16 chanid; 664 u16 chanid;
665 u16 phytype; 665 u16 phytype;
666 int padding; 666 int padding, rate_idx;
667 667
668 memset(&status, 0, sizeof(status)); 668 memset(&status, 0, sizeof(status));
669 669
@@ -766,16 +766,17 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr)
766 } 766 }
767 767
768 if (phystat0 & B43_RX_PHYST0_OFDM) 768 if (phystat0 & B43_RX_PHYST0_OFDM)
769 status.rate_idx = b43_plcp_get_bitrate_idx_ofdm(plcp, 769 rate_idx = b43_plcp_get_bitrate_idx_ofdm(plcp,
770 phytype == B43_PHYTYPE_A); 770 phytype == B43_PHYTYPE_A);
771 else 771 else
772 status.rate_idx = b43_plcp_get_bitrate_idx_cck(plcp); 772 rate_idx = b43_plcp_get_bitrate_idx_cck(plcp);
773 if (unlikely(status.rate_idx == -1)) { 773 if (unlikely(rate_idx == -1)) {
774 /* PLCP seems to be corrupted. 774 /* PLCP seems to be corrupted.
775 * Drop the frame, if we are not interested in corrupted frames. */ 775 * Drop the frame, if we are not interested in corrupted frames. */
776 if (!(dev->wl->filter_flags & FIF_PLCPFAIL)) 776 if (!(dev->wl->filter_flags & FIF_PLCPFAIL))
777 goto drop; 777 goto drop;
778 } 778 }
779 status.rate_idx = rate_idx;
779 status.antenna = !!(phystat0 & B43_RX_PHYST0_ANT); 780 status.antenna = !!(phystat0 & B43_RX_PHYST0_ANT);
780 781
781 /* 782 /*