From 9132292e9912a8977506d90b730a20c13babc353 Mon Sep 17 00:00:00 2001 From: Satheesh Paul Date: Tue, 25 Jan 2022 09:42:48 +0530 Subject: [PATCH] common/cnxk: fix null access in IPv6 flow parsing Added null check in IPv6 flow pattern parsing. Fixes: 474e275b1bc6 ("common/cnxk: support extensions attributes in IPv6 item") Signed-off-by: Satheesh Paul Reviewed-by: Jerin Jacob --- drivers/common/cnxk/roc_npc_parse.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/common/cnxk/roc_npc_parse.c b/drivers/common/cnxk/roc_npc_parse.c index 1f21693369..302ab66efc 100644 --- a/drivers/common/cnxk/roc_npc_parse.c +++ b/drivers/common/cnxk/roc_npc_parse.c @@ -562,9 +562,11 @@ npc_parse_lc(struct npc_parse_state *pst) ipv6_spec = pst->pattern->spec; lid = NPC_LID_LC; lt = NPC_LT_LC_IP6; - rc = npc_handle_ipv6ext_attr(ipv6_spec, pst, &flags); - if (rc) - return rc; + if (ipv6_spec) { + rc = npc_handle_ipv6ext_attr(ipv6_spec, pst, &flags); + if (rc) + return rc; + } info.len = sizeof(ipv6_spec->hdr); break; case ROC_NPC_ITEM_TYPE_ARP_ETH_IPV4: