]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: fix incorrect bit shifting in print_ht_mcs
authorJohn W. Linville <linville@tuxdriver.com>
Wed, 26 Jun 2013 15:07:40 +0000 (11:07 -0400)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 26 Jun 2013 15:22:11 +0000 (17:22 +0200)
iw-3.10/util.c:569:result_independent_of_operands –
"mcs[10] >> 8" is 0 regardless of the values of its operands. This occurs as the bitwise first operand of '&'.

This seems more like what was intended...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
util.c

diff --git a/util.c b/util.c
index d8b76eeb343fcd9f88efe0da5a19c14d55807780..e3d0c270ac446ac604d06e6350a43b0c5582eea0 100644 (file)
--- a/util.c
+++ b/util.c
@@ -574,7 +574,7 @@ void print_ht_mcs(const __u8 *mcs)
        unsigned int tx_max_num_spatial_streams, max_rx_supp_data_rate;
        bool tx_mcs_set_defined, tx_mcs_set_equal, tx_unequal_modulation;
 
-       max_rx_supp_data_rate = ((mcs[10] >> 8) & ((mcs[11] & 0x3) << 8));
+       max_rx_supp_data_rate = (mcs[10] & ((mcs[11] & 0x3) << 8));
        tx_mcs_set_defined = !!(mcs[12] & (1 << 0));
        tx_mcs_set_equal = !(mcs[12] & (1 << 1));
        tx_max_num_spatial_streams = ((mcs[12] >> 2) & 3) + 1;