]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
qed: Correct out-of-bound access in OOO history
authorMintz, Yuval <Yuval.Mintz@cavium.com>
Tue, 14 Mar 2017 13:26:03 +0000 (15:26 +0200)
committerChuck Anderson <chuck.anderson@oracle.com>
Wed, 26 Jul 2017 03:46:43 +0000 (20:46 -0700)
Orabug: 2593305326439680

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>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/qlogic/qed/qed_ooo.c

index 7d731c6cb8923dd927a7bbaafa3a3a97237ba652..378afce58b3f0abd4c2a3bd43f403a50e1a9a1da 100644 (file)
@@ -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: