|
@@ -2108,12 +2108,12 @@ static int t4_uld_rx_handler(void *handle, const __be64 *rsp,
|
|
log_debug(1 << CXGBI_DBG_TOE,
|
|
log_debug(1 << CXGBI_DBG_TOE,
|
|
"cdev %p, opcode 0x%x(0x%x,0x%x), skb %p.\n",
|
|
"cdev %p, opcode 0x%x(0x%x,0x%x), skb %p.\n",
|
|
cdev, opc, rpl->ot.opcode_tid, ntohl(rpl->ot.opcode_tid), skb);
|
|
cdev, opc, rpl->ot.opcode_tid, ntohl(rpl->ot.opcode_tid), skb);
|
|
- if (cxgb4i_cplhandlers[opc])
|
|
|
|
- cxgb4i_cplhandlers[opc](cdev, skb);
|
|
|
|
- else {
|
|
|
|
|
|
+ if (opc >= ARRAY_SIZE(cxgb4i_cplhandlers) || !cxgb4i_cplhandlers[opc]) {
|
|
pr_err("No handler for opcode 0x%x.\n", opc);
|
|
pr_err("No handler for opcode 0x%x.\n", opc);
|
|
__kfree_skb(skb);
|
|
__kfree_skb(skb);
|
|
- }
|
|
|
|
|
|
+ } else
|
|
|
|
+ cxgb4i_cplhandlers[opc](cdev, skb);
|
|
|
|
+
|
|
return 0;
|
|
return 0;
|
|
nomem:
|
|
nomem:
|
|
log_debug(1 << CXGBI_DBG_TOE, "OOM bailing out.\n");
|
|
log_debug(1 << CXGBI_DBG_TOE, "OOM bailing out.\n");
|