diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-06-14 12:10:10 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-06-14 15:20:04 -0400 |
commit | 0331402aeaefe858709b0a4d44ade15f82d3a119 (patch) | |
tree | 5fedec0e046a7ec22c573a51ddb1abc917da2ee9 /drivers/net | |
parent | 44e179da0e27a1cc1001becefa0931634dbafae3 (diff) | |
download | linux-0331402aeaefe858709b0a4d44ade15f82d3a119.tar.bz2 |
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: bbe3f233ec5e ("qed: Assign a unique per-queue index to queue-cid")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/qlogic/qed/qed_l2.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/qlogic/qed/qed_l2.c b/drivers/net/ethernet/qlogic/qed/qed_l2.c index cb8b05dbfc6e..e57699bfbdfa 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_l2.c +++ b/drivers/net/ethernet/qlogic/qed/qed_l2.c @@ -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); |