rsi: correct the logic of deriving queue number
authorAmitkumar Karwar <amit.karwar@redpinesignals.com>
Thu, 6 Jul 2017 14:37:11 +0000 (20:07 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 28 Jul 2017 14:22:36 +0000 (17:22 +0300)
Maximum valid queue number is 0x5. So anding with 0x7 should be
ok here.

Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/rsi/rsi_91x_usb.c

index 25f619506b5888f0cd2ace54536defd544f53234..dc0a0b2e9afc36adfec8a73a63d9fe0716903dbd 100644 (file)
@@ -381,7 +381,7 @@ static int rsi_usb_host_intf_write_pkt(struct rsi_hw *adapter,
                                       u8 *pkt,
                                       u32 len)
 {
-       u32 queueno = ((pkt[1] >> 4) & 0xf);
+       u32 queueno = ((pkt[1] >> 4) & 0x7);
        u8 endpoint;
 
        endpoint = ((queueno == RSI_WIFI_MGMT_Q) ? MGMT_EP : DATA_EP);