From patchwork Mon Jun 14 18:24:48 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reinette Chatre X-Patchwork-Id: 106002 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o5EIP52c002669 for ; Mon, 14 Jun 2010 18:25:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753228Ab0FNSZB (ORCPT ); Mon, 14 Jun 2010 14:25:01 -0400 Received: from mga01.intel.com ([192.55.52.88]:13214 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752828Ab0FNSYz (ORCPT ); Mon, 14 Jun 2010 14:24:55 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 14 Jun 2010 11:20:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.53,415,1272870000"; d="scan'208";a="576289749" Received: from rchatre-desk.jf.intel.com (HELO localhost.localdomain) ([134.134.15.235]) by fmsmga002.fm.intel.com with ESMTP; 14 Jun 2010 11:23:32 -0700 From: Reinette Chatre To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, ipw3945-devel@lists.sourceforge.net, Dor Shaish , Emmanuel Grumbach , Reinette Chatre Subject: [PATCH 2/6] iwlwifi: Fix null pointer referencing in iwl_dbgfs_rx_queue_read. Date: Mon, 14 Jun 2010 11:24:48 -0700 Message-Id: <1276539892-12471-3-git-send-email-reinette.chatre@intel.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1276539892-12471-1-git-send-email-reinette.chatre@intel.com> References: <1276539892-12471-1-git-send-email-reinette.chatre@intel.com> 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 (demeter.kernel.org [140.211.167.41]); Mon, 14 Jun 2010 18:25:11 +0000 (UTC) diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index d9f21bb..cee3d12 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c @@ -1018,8 +1018,13 @@ static ssize_t iwl_dbgfs_rx_queue_read(struct file *file, rxq->write); pos += scnprintf(buf + pos, bufsz - pos, "free_count: %u\n", rxq->free_count); - pos += scnprintf(buf + pos, bufsz - pos, "closed_rb_num: %u\n", + if (rxq->rb_stts) { + pos += scnprintf(buf + pos, bufsz - pos, "closed_rb_num: %u\n", le16_to_cpu(rxq->rb_stts->closed_rb_num) & 0x0FFF); + } else { + pos += scnprintf(buf + pos, bufsz - pos, + "closed_rb_num: Not Allocated\n"); + } return simple_read_from_buffer(user_buf, count, ppos, buf, pos); }