aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMintz, Yuval <Yuval.Mintz@cavium.com>2017-03-14 09:26:03 -0400
committerDavid S. Miller <davem@davemloft.net>2017-03-14 14:37:05 -0400
commitdb31d330e8b0ad8926725eb2af6f6422c07ca7ab (patch)
tree05801e55b20135562c305118b5cd6e500b0eb17b
parent1df2adedcce17ad4a39fba74f0e2b611f797fe10 (diff)
qed: Correct out-of-bound access in OOO history
Need to set the number of entries in database, otherwise the logic would quickly surpass the array. Fixes: 1d6cff4fca43 ("qed: Add iSCSI out of order packet handling") Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/qlogic/qed/qed_ooo.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/qlogic/qed/qed_ooo.c b/drivers/net/ethernet/qlogic/qed/qed_ooo.c
index 7d731c6cb892..378afce58b3f 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_ooo.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_ooo.c
@@ -159,6 +159,8 @@ struct qed_ooo_info *qed_ooo_alloc(struct qed_hwfn *p_hwfn)
159 if (!p_ooo_info->ooo_history.p_cqes) 159 if (!p_ooo_info->ooo_history.p_cqes)
160 goto no_history_mem; 160 goto no_history_mem;
161 161
162 p_ooo_info->ooo_history.num_of_cqes = QED_MAX_NUM_OOO_HISTORY_ENTRIES;
163
162 return p_ooo_info; 164 return p_ooo_info;
163 165
164no_history_mem: 166no_history_mem: