From: Mintz, Yuval Date: Tue, 14 Mar 2017 13:26:03 +0000 (+0200) Subject: qed: Correct out-of-bound access in OOO history X-Git-Tag: v4.1.12-107.0.20170801_2000~106 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=b4589fe442b2063738abb2a9f95dee29ff4ea6be;p=users%2Fjedix%2Flinux-maple.git qed: Correct out-of-bound access in OOO history Orabug: 25933053, 26439680 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 Signed-off-by: David S. Miller Signed-off-by: Brian Maly --- 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) if (!p_ooo_info->ooo_history.p_cqes) goto no_history_mem; + p_ooo_info->ooo_history.num_of_cqes = QED_MAX_NUM_OOO_HISTORY_ENTRIES; + return p_ooo_info; no_history_mem: