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 557A0A0547; Mon, 24 May 2021 11:01:52 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 434FE41105; Mon, 24 May 2021 11:01:52 +0200 (CEST) Received: from proxy.6wind.com (host.78.145.23.62.rev.coltfrance.com [62.23.145.78]) by mails.dpdk.org (Postfix) with ESMTP id 4AA584003C; Mon, 24 May 2021 11:01:51 +0200 (CEST) Received: from localhost (unknown [10.16.0.39]) by proxy.6wind.com (Postfix) with ESMTP id 3BF5A9B47B7; Mon, 24 May 2021 11:01:51 +0200 (CEST) From: Thierry Herbelot To: dev@dpdk.org Cc: Thierry Herbelot , Thomas Monjalon , stable@dpdk.org, Ori Kam Date: Mon, 24 May 2021 11:01:44 +0200 Message-Id: <20210524090144.16908-1-thierry.herbelot@6wind.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] app/testpmd: do not use a possibly NULL Pointer 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 Sender: "dev" Use out only after it was checked not to be NULL. Fixes: 4d07cbefe3ba0 ("app/testpmd: add commands for conntrack") Cc: stable@dpdk.org Cc: Ori Kam Signed-off-by: Thierry Herbelot --- app/test-pmd/cmdline_flow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 1c587bb7b803..7645b3cc90a1 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -6631,10 +6631,10 @@ parse_vc_action_conntrack_update(struct context *ctx, const struct token *token, /* Token name must match. */ if (parse_default(ctx, token, str, len, NULL, 0) < 0) return -1; - ct_modify = (struct rte_flow_modify_conntrack *)out->args.vc.data; /* Nothing else to do if there is no buffer. */ if (!out) return len; + ct_modify = (struct rte_flow_modify_conntrack *)out->args.vc.data; if (ctx->curr == ACTION_CONNTRACK_UPDATE_DIR) { ct_modify->new_ct.is_original_dir = conntrack_context.is_original_dir; -- 2.29.2