From: Reinette Chatre <reinette.chatre@intel.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
ipw3945-devel@lists.sourceforge.net,
Dor Shaish <dor.shaish@intel.com>,
Emmanuel Grumbach <emmanuel.grumbach@intel.com>,
Reinette Chatre <reinette.chatre@intel.com>
Subject: [PATCH 2/6] iwlwifi: Fix null pointer referencing in iwl_dbgfs_rx_queue_read.
Date: Mon, 14 Jun 2010 11:24:48 -0700 [thread overview]
Message-ID: <1276539892-12471-3-git-send-email-reinette.chatre@intel.com> (raw)
In-Reply-To: <1276539892-12471-1-git-send-email-reinette.chatre@intel.com>
From: Dor Shaish <dor.shaish@intel.com>
Test for null pointer prior to access.
Print "Not Allocated" if null pointer.
Signed-off-by: Dor Shaish <dor.shaish@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
drivers/net/wireless/iwlwifi/iwl-debugfs.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
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);
}
--
1.7.0.4
next prev parent reply other threads:[~2010-06-14 18:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-14 18:24 [PATCH 0/6] iwlwifi updates for 2.6.36 Reinette Chatre
2010-06-14 18:24 ` [PATCH 1/6] iwlwifi: trace full RX Reinette Chatre
2010-06-14 18:24 ` Reinette Chatre [this message]
2010-06-14 18:24 ` [PATCH 3/6] iwlwifi: cancel run time calibration work when going down Reinette Chatre
2010-06-14 18:24 ` [PATCH 4/6] iwlwifi: rename rxq->dma_addr Reinette Chatre
2010-06-14 18:24 ` [PATCH 5/6] iwlwifi: rename iwl4965_rx_mpdu_res_start Reinette Chatre
2010-06-14 18:24 ` [PATCH 6/6] iwlwifi: print warning about disconnected antennas Reinette Chatre
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1276539892-12471-3-git-send-email-reinette.chatre@intel.com \
--to=reinette.chatre@intel.com \
--cc=dor.shaish@intel.com \
--cc=emmanuel.grumbach@intel.com \
--cc=ipw3945-devel@lists.sourceforge.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox