1 From foo@baz Wed Aug 22 10:28:26 CEST 2018
2 From: Sudarsana Reddy Kalluru <sudarsana.kalluru@cavium.com>
3 Date: Mon, 18 Jun 2018 21:58:01 -0700
4 Subject: qed: Add sanity check for SIMD fastpath handler.
6 From: Sudarsana Reddy Kalluru <sudarsana.kalluru@cavium.com>
8 [ Upstream commit 3935a70968820c3994db4de7e6e1c7e814bff875 ]
10 Avoid calling a SIMD fastpath handler if it is NULL. The check is needed
11 to handle an unlikely scenario where unsolicited interrupt is destined to
14 Fixes: fe56b9e6a ("qed: Add module with basic common support")
15 Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
16 Signed-off-by: Ariel Elior <ariel.elior@cavium.com>
17 Signed-off-by: Michal Kalderon <Michal.Kalderon@cavium.com>
18 Signed-off-by: David S. Miller <davem@davemloft.net>
19 Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
20 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 drivers/net/ethernet/qlogic/qed/qed_main.c | 12 ++++++++++--
23 1 file changed, 10 insertions(+), 2 deletions(-)
25 --- a/drivers/net/ethernet/qlogic/qed/qed_main.c
26 +++ b/drivers/net/ethernet/qlogic/qed/qed_main.c
27 @@ -461,8 +461,16 @@ static irqreturn_t qed_single_int(int ir
28 /* Fastpath interrupts */
29 for (j = 0; j < 64; j++) {
30 if ((0x2ULL << j) & status) {
31 - hwfn->simd_proto_handler[j].func(
32 - hwfn->simd_proto_handler[j].token);
33 + struct qed_simd_fp_handler *p_handler =
34 + &hwfn->simd_proto_handler[j];
36 + if (p_handler->func)
37 + p_handler->func(p_handler->token);
40 + "Not calling fastpath handler as it is NULL [handler #%d, status 0x%llx]\n",
43 status &= ~(0x2ULL << j);