Commit f5cc6a22 authored by Dor Shaish's avatar Dor Shaish Committed by Reinette Chatre

iwlwifi: Fix null pointer referencing in iwl_dbgfs_rx_queue_read.

Test for null pointer prior to access.
Print "Not Allocated" if null pointer.
Signed-off-by: default avatarDor Shaish <dor.shaish@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
parent f4989d9b
...@@ -1018,8 +1018,13 @@ static ssize_t iwl_dbgfs_rx_queue_read(struct file *file, ...@@ -1018,8 +1018,13 @@ static ssize_t iwl_dbgfs_rx_queue_read(struct file *file,
rxq->write); rxq->write);
pos += scnprintf(buf + pos, bufsz - pos, "free_count: %u\n", pos += scnprintf(buf + pos, bufsz - pos, "free_count: %u\n",
rxq->free_count); rxq->free_count);
if (rxq->rb_stts) {
pos += scnprintf(buf + pos, bufsz - pos, "closed_rb_num: %u\n", pos += scnprintf(buf + pos, bufsz - pos, "closed_rb_num: %u\n",
le16_to_cpu(rxq->rb_stts->closed_rb_num) & 0x0FFF); 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); return simple_read_from_buffer(user_buf, count, ppos, buf, pos);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment