From patchwork Tue Dec 21 09:42:43 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasanthakumar Thiagarajan X-Patchwork-Id: 423911 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBL9ggBZ009353 for ; Tue, 21 Dec 2010 09:42:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933650Ab0LUJml (ORCPT ); Tue, 21 Dec 2010 04:42:41 -0500 Received: from mail.atheros.com ([12.19.149.2]:24205 "EHLO mail.atheros.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933382Ab0LUJmk (ORCPT ); Tue, 21 Dec 2010 04:42:40 -0500 Received: from mail.atheros.com ([10.10.20.105]) by sidewinder.atheros.com for ; Tue, 21 Dec 2010 01:42:24 -0800 Received: from CHEXHC-01.global.atheros.com (10.12.0.100) by SC1EXHC-01.global.atheros.com (10.10.20.104) with Microsoft SMTP Server (TLS) id 8.2.213.0; Tue, 21 Dec 2010 01:42:40 -0800 Received: from smtpch.atheros.com (10.12.4.43) by CHEXHC-01.global.atheros.com (10.12.0.100) with Microsoft SMTP Server (TLS) id 8.2.176.0; Tue, 21 Dec 2010 15:12:35 +0530 Received: by smtpch.atheros.com (sSMTP sendmail emulation); Tue, 21 Dec 2010 01:42:43 -0800 From: Vasanthakumar Thiagarajan To: CC: Subject: [PATCH] ath9k_hw: Fix bug in eeprom data length validation for AR9485 Date: Tue, 21 Dec 2010 01:42:43 -0800 Message-ID: <1292924563-3339-1-git-send-email-vasanth@atheros.com> X-Mailer: git-send-email 1.7.0.4 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 21 Dec 2010 09:42:43 +0000 (UTC) diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c index f80ec74..579a033 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c @@ -59,6 +59,8 @@ #define CTL(_tpower, _flag) ((_tpower) | ((_flag) << 6)) +#define EEPROM_DATA_LEN_9485 1088 + static int ar9003_hw_power_interpolate(int32_t x, int32_t *px, int32_t *py, u_int16_t np); @@ -3367,7 +3369,7 @@ found: "Found block at %x: code=%d ref=%d length=%d major=%d minor=%d\n", cptr, code, reference, length, major, minor); if ((!AR_SREV_9485(ah) && length >= 1024) || - (AR_SREV_9485(ah) && length >= (4 * 1024))) { + (AR_SREV_9485(ah) && length > EEPROM_DATA_LEN_9485)) { ath_dbg(common, ATH_DBG_EEPROM, "Skipping bad header\n"); cptr -= COMP_HDR_LEN;