From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754008AbbE1PEX (ORCPT ); Thu, 28 May 2015 11:04:23 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:46322 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751815AbbE1PEP (ORCPT ); Thu, 28 May 2015 11:04:15 -0400 From: Sasha Levin To: johnny.kim@atmel.com, rachel.kim@atmel.com, dean.lee@atmel.com, chris.park@atmel.com, nicolas.ferre@atmel.com Cc: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Sasha Levin Subject: [PATCH] staging: wilc1000: off by one in wilc_wfi_cfg80211_mgmt_types Date: Thu, 28 May 2015 11:03:56 -0400 Message-Id: <1432825436-9800-1-git-send-email-sasha.levin@oracle.com> X-Mailer: git-send-email 2.1.0 X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/staging/wilc1000/wilc_wfi_cfgoperations.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h index 9eb8f37..3a63fbd 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h @@ -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) | -- 1.7.10.4