From patchwork Thu Jun 22 16:58:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 9804857 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8E9B160386 for ; Thu, 22 Jun 2017 16:58:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F1F928474 for ; Thu, 22 Jun 2017 16:58:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 72F6A2858F; Thu, 22 Jun 2017 16:58:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DA3E28474 for ; Thu, 22 Jun 2017 16:58:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753368AbdFVQ6N (ORCPT ); Thu, 22 Jun 2017 12:58:13 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:47622 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752227AbdFVQ6M (ORCPT ); Thu, 22 Jun 2017 12:58:12 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1dO5Qj-0005DE-9C; Thu, 22 Jun 2017 16:58:05 +0000 From: Colin King To: Kalle Valo , Colin Ian King , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rsi: add in missing RSI_FSM_STATES into array fsm_state Date: Thu, 22 Jun 2017 17:58:04 +0100 Message-Id: <20170622165804.24379-1-colin.king@canonical.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Colin Ian King Two recent commits added new RSI_FSM_STATES (namely FSM_FW_NOT_LOADED and FSM_COMMON_DEV_PARAMS_SENT) and the corresponding table fsm_state was not updated to match. This can lead to an array overrun when accessing the latter two states in fsm_state. Fix this by adding in the missing states. Detected by CoverityScan, CID#1398379 ("Illegal address computation") Fixes: 9920322ccd8e04 ("rsi: add tx frame for common device configuration") Fixes: 015e367494c1d5 ("rsi: Register interrupt handler before firmware load") Signed-off-by: Colin Ian King --- drivers/net/wireless/rsi/rsi_91x_debugfs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/rsi/rsi_91x_debugfs.c b/drivers/net/wireless/rsi/rsi_91x_debugfs.c index 828a042f903f..4c0a493bd44e 100644 --- a/drivers/net/wireless/rsi/rsi_91x_debugfs.c +++ b/drivers/net/wireless/rsi/rsi_91x_debugfs.c @@ -125,7 +125,9 @@ static int rsi_stats_read(struct seq_file *seq, void *data) struct rsi_common *common = seq->private; unsigned char fsm_state[][32] = { + "FSM_FW_NOT_LOADED", "FSM_CARD_NOT_READY", + "FSM_COMMON_DEV_PARAMS_SENT", "FSM_BOOT_PARAMS_SENT", "FSM_EEPROM_READ_MAC_ADDR", "FSM_RESET_MAC_SENT",