提交 0331402a 编写于 作者: D Dan Carpenter 提交者: David S. Miller

qed: Fix an off by one bug

The p_l2_info->pp_qid_usage[] array has "p_l2_info->queues" elements so
the > here should be a >= or we write beyond the end of the array.

Fixes: bbe3f233 ("qed: Assign a unique per-queue index to queue-cid")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Acked-by: NYuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 44e179da
......@@ -161,7 +161,7 @@ static bool qed_eth_queue_qid_usage_add(struct qed_hwfn *p_hwfn,
mutex_lock(&p_l2_info->lock);
if (queue_id > p_l2_info->queues) {
if (queue_id >= p_l2_info->queues) {
DP_NOTICE(p_hwfn,
"Requested to increase usage for qzone %04x out of %08x\n",
queue_id, p_l2_info->queues);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册