Return-path: Received: from mail.atheros.com ([12.36.123.2]:24314 "EHLO mail.atheros.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751078AbZCIEGE (ORCPT ); Mon, 9 Mar 2009 00:06:04 -0400 Received: from mail.atheros.com ([10.10.20.105]) by sidewinder.atheros.com for ; Sun, 08 Mar 2009 21:06:03 -0700 From: Sujith MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Message-ID: <18868.38073.487629.764071@gargle.gargle.HOWL> (sfid-20090309_050613_465066_CBAE1280) Date: Mon, 9 Mar 2009 09:32:01 +0530 To: CC: , , Subject: [PATCH 3/3] ath9k: Fix bug in reading debugfs file 'rcstat' Sender: linux-wireless-owner@vger.kernel.org List-ID: The rate table would not have been chosen before the interface has been brought up. Reading 'rcstat' in this case would result in an oops, fix this. Signed-off-by: Sujith --- drivers/net/wireless/ath9k/debug.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/net/wireless/ath9k/debug.c b/drivers/net/wireless/ath9k/debug.c index b0ff479..82573ca 100644 --- a/drivers/net/wireless/ath9k/debug.c +++ b/drivers/net/wireless/ath9k/debug.c @@ -322,6 +322,9 @@ static ssize_t read_file_rcstat(struct file *file, char __user *user_buf, { struct ath_softc *sc = file->private_data; + if (sc->cur_rate_table == NULL) + return 0; + if (conf_is_ht(&sc->hw->conf)) return ath_read_file_stat_11n_rc(file, user_buf, count, ppos); else -- 1.6.1