Skip to content

Commit f0e199f

Browse files
Sudarsana Reddy Kallurugregkh
authored andcommitted
qed: Add sanity check for SIMD fastpath handler.
[ Upstream commit 3935a70 ] Avoid calling a SIMD fastpath handler if it is NULL. The check is needed to handle an unlikely scenario where unsolicited interrupt is destined to a PF in INTa mode. Fixes: fe56b9e ("qed: Add module with basic common support") Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com> Signed-off-by: Ariel Elior <ariel.elior@cavium.com> Signed-off-by: Michal Kalderon <Michal.Kalderon@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d5a3620 commit f0e199f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

drivers/net/ethernet/qlogic/qed/qed_main.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,8 +461,16 @@ static irqreturn_t qed_single_int(int irq, void *dev_instance)
461461
/* Fastpath interrupts */
462462
for (j = 0; j < 64; j++) {
463463
if ((0x2ULL << j) & status) {
464-
hwfn->simd_proto_handler[j].func(
465-
hwfn->simd_proto_handler[j].token);
464+
struct qed_simd_fp_handler *p_handler =
465+
&hwfn->simd_proto_handler[j];
466+
467+
if (p_handler->func)
468+
p_handler->func(p_handler->token);
469+
else
470+
DP_NOTICE(hwfn,
471+
"Not calling fastpath handler as it is NULL [handler #%d, status 0x%llx]\n",
472+
j, status);
473+
466474
status &= ~(0x2ULL << j);
467475
rc = IRQ_HANDLED;
468476
}

0 commit comments

Comments
 (0)