From d80f6d6665a6aa5875327f12491c90f428bf50b1 Mon Sep 17 00:00:00 2001 From: Yang Yingliang Date: Wed, 28 Jul 2021 17:16:31 +0800 Subject: [PATCH] nfp: flower-ct: fix error return code in nfp_fl_ct_add_offload() If nfp_tunnel_add_ipv6_off() fails, it should return error code in nfp_fl_ct_add_offload(). Fixes: 5a2b93041646 ("nfp: flower-ct: compile match sections of flow_payload") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Signed-off-by: Louis Peens Reviewed-by: Simon Horman Signed-off-by: David S. Miller --- drivers/net/ethernet/netronome/nfp/flower/conntrack.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/flower/conntrack.c b/drivers/net/ethernet/netronome/nfp/flower/conntrack.c index 1ac3b65df600..bfd7d1c35076 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/conntrack.c +++ b/drivers/net/ethernet/netronome/nfp/flower/conntrack.c @@ -710,8 +710,10 @@ static int nfp_fl_ct_add_offload(struct nfp_fl_nft_tc_merge *m_entry) dst = &gre_match->ipv6.dst; entry = nfp_tunnel_add_ipv6_off(priv->app, dst); - if (!entry) + if (!entry) { + err = -ENOMEM; goto ct_offload_err; + } flow_pay->nfp_tun_ipv6 = entry; } else { @@ -760,8 +762,10 @@ static int nfp_fl_ct_add_offload(struct nfp_fl_nft_tc_merge *m_entry) dst = &udp_match->ipv6.dst; entry = nfp_tunnel_add_ipv6_off(priv->app, dst); - if (!entry) + if (!entry) { + err = -ENOMEM; goto ct_offload_err; + } flow_pay->nfp_tun_ipv6 = entry; } else {