From patchwork Sun Aug 5 19:35:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Kossifidis X-Patchwork-Id: 1275611 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 96C79DF27F for ; Sun, 5 Aug 2012 19:36:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755013Ab2HETgi (ORCPT ); Sun, 5 Aug 2012 15:36:38 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:34401 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754903Ab2HETgi (ORCPT ); Sun, 5 Aug 2012 15:36:38 -0400 Received: by wibhr14 with SMTP id hr14so1067677wib.1 for ; Sun, 05 Aug 2012 12:36:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=JRBBRtdhTa9nQr9508tDJrXkBMKWRIFI+juTM/3o+/A=; b=tSW7+0rtk5/Dy4XaczwUJ87Tu6atbw5uKtaMpN93VV8uLHTRu/6XHVrXSFSDvl+6Bk i0SYwA3NJQx4Bon1hZtd0SRm5j2GzcVQ+9eBifjdJ2DiXcaSI/ByZ0tGrPg3I+ofBDgj 3o2jolgDtutaSk+0bXBy7qP1JQbJHGnzFdHETSfzDjZv0wWs9mWc4y4nW5YS7RF4ZbGh Eu5jRcw9q5L5VsrCkGgndikDaeM9ONXAY3wBHkd9QKy3kzlxiLwy/z5QhPd5gtFANb8m iYbMLEhhrkjB+WDXBKiPi3u2MkXWegr5uUOkJNjIGq/mIxvm5Z3HKLRz3vUGAJGpohAr Aw8Q== Received: by 10.180.99.196 with SMTP id es4mr12266305wib.18.1344195397193; Sun, 05 Aug 2012 12:36:37 -0700 (PDT) Received: from localhost.localdomain (athedsl-133041.home.otenet.gr. [85.75.95.80]) by mx.google.com with ESMTPS id b7sm16708044wiz.9.2012.08.05.12.36.30 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 05 Aug 2012 12:36:36 -0700 (PDT) From: Nick Kossifidis To: ath5k-devel@lists.ath5k.org, linux-wireless@vger.kernel.org Cc: linville@tuxdriver.com, mcgrof@gmail.com, jirislaby@gmail.com, thomas@net.t-labs.tu-berlin.de, nbd@openwrt.org, Nick Kossifidis Subject: [PATCH v2 5/5] ath5k: Return correct offset when reading frequencies Date: Sun, 5 Aug 2012 22:35:37 +0300 Message-Id: <1344195337-27461-6-git-send-email-mickflemm@gmail.com> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1344195337-27461-1-git-send-email-mickflemm@gmail.com> References: <1344195337-27461-1-git-send-email-mickflemm@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org If we have a zeroed frequency on the calibration piers it means that we shouldn't use that pier, not stop reading the EEPROM and break out from the loop. By doing that we return the wrong offset and the whole dataset gets corrupted. Signed-off-by: Nick Kossifidis Tested-by: Thomas Huehn --- drivers/net/wireless/ath/ath5k/eeprom.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath5k/eeprom.c b/drivers/net/wireless/ath/ath5k/eeprom.c index 4026c90..10a4396 100644 --- a/drivers/net/wireless/ath/ath5k/eeprom.c +++ b/drivers/net/wireless/ath/ath5k/eeprom.c @@ -522,7 +522,7 @@ ath5k_eeprom_read_freq_list(struct ath5k_hw *ah, int *offset, int max, freq1 = val & 0xff; if (!freq1) - break; + continue; pc[i++].freq = ath5k_eeprom_bin2freq(ee, freq1, mode); @@ -530,7 +530,7 @@ ath5k_eeprom_read_freq_list(struct ath5k_hw *ah, int *offset, int max, freq2 = (val >> 8) & 0xff; if (!freq2) - break; + continue; pc[i++].freq = ath5k_eeprom_bin2freq(ee, freq2, mode);