提交 f5cc6a22 编写于 作者: D Dor Shaish 提交者: 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: NDor Shaish <dor.shaish@intel.com>
Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: NReinette Chatre <reinette.chatre@intel.com>
上级 f4989d9b
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册