common/cnxk: fix null access in IPv6 flow parsing

Added null check in IPv6 flow pattern parsing.

Fixes: 474e275b1b ("common/cnxk: support extensions attributes in IPv6 item")

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
This commit is contained in:
Satheesh Paul 2022-01-25 09:42:48 +05:30 committed by Jerin Jacob
parent d8c079a572
commit 9132292e99

View File

@ -562,9 +562,11 @@ npc_parse_lc(struct npc_parse_state *pst)
ipv6_spec = pst->pattern->spec; ipv6_spec = pst->pattern->spec;
lid = NPC_LID_LC; lid = NPC_LID_LC;
lt = NPC_LT_LC_IP6; lt = NPC_LT_LC_IP6;
rc = npc_handle_ipv6ext_attr(ipv6_spec, pst, &flags); if (ipv6_spec) {
if (rc) rc = npc_handle_ipv6ext_attr(ipv6_spec, pst, &flags);
return rc; if (rc)
return rc;
}
info.len = sizeof(ipv6_spec->hdr); info.len = sizeof(ipv6_spec->hdr);
break; break;
case ROC_NPC_ITEM_TYPE_ARP_ETH_IPV4: case ROC_NPC_ITEM_TYPE_ARP_ETH_IPV4: