From patchwork Thu Jun 16 16:58:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Abinader X-Patchwork-Id: 9181371 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 C7E7E60760 for ; Thu, 16 Jun 2016 16:59:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B0A3528359 for ; Thu, 16 Jun 2016 16:59:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A506128364; Thu, 16 Jun 2016 16:59:00 +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=ham 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 CBF8928359 for ; Thu, 16 Jun 2016 16:58:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754020AbcFPQ65 (ORCPT ); Thu, 16 Jun 2016 12:58:57 -0400 Received: from eng.riverbed.com ([208.70.196.45]:15628 "EHLO smtp1.riverbed.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752655AbcFPQ64 (ORCPT ); Thu, 16 Jun 2016 12:58:56 -0400 Received: from unknown (HELO tlssmtp) ([10.16.4.52]) by smtp1.riverbed.com with ESMTP; 16 Jun 2016 09:58:51 -0700 Received: from [10.20.14.55] (unknown [5.158.136.57]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by tlssmtp (Postfix) with ESMTP id AC5CF6B943; Thu, 16 Jun 2016 09:58:49 -0700 (PDT) To: ath9k-devel@lists.ath9k.org Cc: linux-wireless@vger.kernel.org, kvalo@qca.qualcomm.com From: Eduardo Abinader Subject: [PATCH] ath9k: return false when reading wrong eeprom offset Message-ID: <5762DAC7.8090904@riverbed.com> Date: Thu, 16 Jun 2016 18:58:47 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.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 Just setting the proper return for reading beyond the eeprom data. Signed-off-by: Eduardo Abinader Reviewed-by: Julian Calaby --- drivers/net/wireless/ath/ath9k/pci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c index 7cdaf40..aa04b13 100644 --- a/drivers/net/wireless/ath/ath9k/pci.c +++ b/drivers/net/wireless/ath/ath9k/pci.c @@ -794,6 +794,8 @@ static bool ath_pci_eeprom_read(struct ath_common *common, u32 off, u16 *data) ath_err(common, "%s: eeprom read failed, offset %08x is out of range\n", __func__, off); + + return false; } *data = pdata->eeprom_data[off];