]> git.droids-corp.org - dpdk.git/commitdiff
net/enic: fix dereference before null check
authorJohn Daley <johndale@cisco.com>
Mon, 14 Feb 2022 20:46:10 +0000 (12:46 -0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 15 Feb 2022 12:54:39 +0000 (13:54 +0100)
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")
Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Hyong Youb Kim <hyonkim@cisco.com>
drivers/net/enic/enic_fm_flow.c

index f0bda19a7090c80d3ac8c8e7cd37648960921624..c87d3af8476cc3e663d444e3ddc90a86d0a80dc8 100644 (file)
@@ -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;
                }