Skip to content

Commit 1b1b5bb

Browse files
ajaykathatnoglitch
authored andcommitted
wilc1000: add vmm_table entry validity check before accessing Txq
Add Tx VMM buffer validity check before accessing the buffer entity to avoid any access to invalid value. It's handled by moving 'vmm_table' entry check before calling wilc_wlan_txq_remove_from_head(). Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
1 parent 08b7ddd commit 1b1b5bb

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • drivers/net/wireless/microchip/wilc1000

drivers/net/wireless/microchip/wilc1000/wlan.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,14 +1152,14 @@ int wilc_wlan_handle_txq(struct wilc *wilc, u32 *txq_count)
11521152
u32 header, buffer_offset;
11531153
u8 mgmt_ptk = 0;
11541154

1155-
tqe = wilc_wlan_txq_remove_from_head(wilc, vmm_entries_ac[i]);
1156-
ac_pkt_num_to_chip[vmm_entries_ac[i]]++;
1157-
if (!tqe)
1155+
if (vmm_table[i] == 0 || vmm_entries_ac[i] >= NQUEUES)
11581156
break;
11591157

1160-
if (vmm_table[i] == 0)
1158+
tqe = wilc_wlan_txq_remove_from_head(wilc, vmm_entries_ac[i]);
1159+
if (!tqe)
11611160
break;
11621161

1162+
ac_pkt_num_to_chip[vmm_entries_ac[i]]++;
11631163
vif = tqe->vif;
11641164
le32_to_cpus(&vmm_table[i]);
11651165
vmm_sz = FIELD_GET(WILC_VMM_BUFFER_SIZE, vmm_table[i]);

0 commit comments

Comments
 (0)