app/testpmd: move conntrack update after null check
authorThierry Herbelot <thierry.herbelot@6wind.com>
Mon, 24 May 2021 09:01:44 +0000 (11:01 +0200)
committerAndrew Rybchenko <Andrew.Rybchenko@oktetlabs.ru>
Fri, 2 Jul 2021 17:03:03 +0000 (19:03 +0200)
Use out only after it was checked not to be null.

Fixes: 4d07cbefe3ba0 ("app/testpmd: add commands for conntrack")
Cc: stable@dpdk.org
Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
Reviewed-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Aman Deep Singh <aman.deep.singh@intel.com>
app/test-pmd/cmdline_flow.c

index 1c587bb..7645b3c 100644 (file)
@@ -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;