staging: wilc1000: off by one in wilc_wfi_cfg80211_mgmt_types
PATCH 1/1 staging: wilc1000: off by one in wilc_wfi_cfg80211_mgmt_types
NL80211_IFTYPE_MAX represents the largest interface type number defined, so declaring the array with that size will actually leave out the last interface.
This causes invalid memory access whenever this array is used, which starts happening at boot.
Signed-off-by Sasha Levin <[email protected]>
--- drivers/staging/wilc1000/wilc_wfi_cfgoperations.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wilc1000/wilc_wfi_cfgoperations.h +1 -1
@@ -82,7 +82,7 @@ static const u32 cipher_suites[] = { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37) static const struct ieee80211_txrx_stypes - wilc_wfi_cfg80211_mgmt_types[NL80211_IFTYPE_MAX] = { + wilc_wfi_cfg80211_mgmt_types[NUM_NL80211_IFTYPES] = { [NL80211_IFTYPE_STATION] = { .tx = 0xffff, .rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
Signature · 1 line
1.7.10.4