Skip to contentSkip to conversation

net/enic: fix dereference before null check

PATCH Applied John Daley 2 participants 2 messages Feb 14, 2022 – Feb 15, 2022 Network drivers

lore
Share & tools
lore

John Daley

author
#0 lore raw

PATCH 1/1 net/enic: fix dereference before null check

This patch fixes an issue found by coverity. It checks for a possible null value of "error" before dereferencing it.

CID: 375064: Dereference after null check
Either the check against null is unnecessary, or there may be a null pointer dereference.

Coverity issue: 375064

Fixes ee806eea59fe ("net/enic: support GENEVE flow item")
---
 drivers/net/enic/enic_fm_flow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/enic/enic_fm_flow.c +1 -1
index f0bda19a70..c87d3af847 100644
@@ -1204,7 +1204,7 @@ enic_fm_copy_entry(struct enic_flowman *fm,
 		ret = item_info->copy_item(&args);
 		if (ret) {
 			/* If copy_item set the error, return that */
-			if (error->type != RTE_FLOW_ERROR_TYPE_NONE)
+			if (error && error->type != RTE_FLOW_ERROR_TYPE_NONE)
 				return ret;
 			goto item_not_supported;
 		}
Signature · 1 line
2.33.1
Applied
#1 lore raw
Quoted 7 lines · John Daley

This patch fixes an issue found by coverity. It checks for a possible null value of "error" before dereferencing it.

CID: 375064: Dereference after null check
Either the check against null is unnecessary, or there may be a null pointer dereference.

Quoted 5 lines

Coverity issue: 375064

Fixes ee806eea59fe ("net/enic: support GENEVE flow item")

Applied to dpdk-next-net/main, thanks.