From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E515AA034F; Mon, 14 Feb 2022 21:46:27 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 74459410F6; Mon, 14 Feb 2022 21:46:27 +0100 (CET) Received: from alln-iport-2.cisco.com (alln-iport-2.cisco.com [173.37.142.89]) by mails.dpdk.org (Postfix) with ESMTP id 7097E40DDA for ; Mon, 14 Feb 2022 21:46:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1080; q=dns/txt; s=iport; t=1644871586; x=1646081186; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=hNIgxL0ROmXXd6eBNPG9iEuej8B6nk5DoCYt5a3HJJw=; b=EZMGG5I/laIelyc7StdSlprI+tlpH33qvfLJS6dB5kijupXQ9DTMxdbA 3n2khkQU5DZt6CooaXrwR8xQIlQURlvBrpfLZ3vdFSV1AxJxCYsV5iTKS 08PInXlWohmi0gSgp6X9OeLP+KBFCNsCL9/mUJV3gOITGnnxuwLf73ILK 8=; X-IronPort-AV: E=Sophos;i="5.88,368,1635206400"; d="scan'208";a="838451407" Received: from alln-core-10.cisco.com ([173.36.13.132]) by alln-iport-2.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 14 Feb 2022 20:46:24 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by alln-core-10.cisco.com (8.15.2/8.15.2) with ESMTP id 21EKkOgP027461; Mon, 14 Feb 2022 20:46:24 GMT Received: by cisco.com (Postfix, from userid 392789) id 4708E20F2003; Mon, 14 Feb 2022 12:46:24 -0800 (PST) From: John Daley To: ferruh.yigit@intel.com, arybchenko@solarflare.com Cc: dev@dpdk.org, John Daley , Hyong Youb Kim Subject: [PATCH] net/enic: fix dereference before null check Date: Mon, 14 Feb 2022 12:46:10 -0800 Message-Id: <20220214204610.14921-1-johndale@cisco.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Outbound-SMTP-Client: 10.193.184.48, savbu-usnic-a.cisco.com X-Outbound-Node: alln-core-10.cisco.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 Reviewed-by: Hyong Youb Kim --- drivers/net/enic/enic_fm_flow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/enic/enic_fm_flow.c b/drivers/net/enic/enic_fm_flow.c index f0bda19a70..c87d3af847 100644 --- a/drivers/net/enic/enic_fm_flow.c +++ b/drivers/net/enic/enic_fm_flow.c @@ -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; } -- 2.33.1