diff mbox series

[net-next] nfp: flower-ct: check for error in nfp_fl_ct_offload_nft_flow()

Message ID YM321r7Enw8sGj0X@mwanda (mailing list archive)
State Accepted
Commit 43c9a8111680043d065025510a034336417084d1
Delegated to: Netdev Maintainers
Headers show
Series [net-next] nfp: flower-ct: check for error in nfp_fl_ct_offload_nft_flow() | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

Dan Carpenter June 19, 2021, 1:53 p.m. UTC
The nfp_fl_ct_add_flow() function can fail so we need to check for
failure.

Fixes: 95255017e0a8 ("nfp: flower-ct: add nft flows to nft list")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/net/ethernet/netronome/nfp/flower/conntrack.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Louis Peens June 21, 2021, 5:15 a.m. UTC | #1
On 2021/06/19 15:53, Dan Carpenter wrote:
> The nfp_fl_ct_add_flow() function can fail so we need to check for
> failure.
> 
> Fixes: 95255017e0a8 ("nfp: flower-ct: add nft flows to nft list")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Ah, of course, thank you.
Reviewed-by: Louis Peens <louis.peens@corigine.com>
> ---
>  drivers/net/ethernet/netronome/nfp/flower/conntrack.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/ethernet/netronome/nfp/flower/conntrack.c b/drivers/net/ethernet/netronome/nfp/flower/conntrack.c
> index 9ea77bb3b69c..273d529d43c2 100644
> --- a/drivers/net/ethernet/netronome/nfp/flower/conntrack.c
> +++ b/drivers/net/ethernet/netronome/nfp/flower/conntrack.c
> @@ -1067,6 +1067,8 @@ nfp_fl_ct_offload_nft_flow(struct nfp_fl_ct_zone_entry *zt, struct flow_cls_offl
>  						    nfp_ct_map_params);
>  		if (!ct_map_ent) {
>  			ct_entry = nfp_fl_ct_add_flow(zt, NULL, flow, true, extack);
> +			if (IS_ERR(ct_entry))
> +				return PTR_ERR(ct_entry);
>  			ct_entry->type = CT_TYPE_NFT;
>  			list_add(&ct_entry->list_node, &zt->nft_flows_list);
>  			zt->nft_flows_count++;
>
Simon Horman June 21, 2021, 9:22 a.m. UTC | #2
On Mon, Jun 21, 2021 at 07:15:08AM +0200, Louis Peens wrote:
> 
> 
> On 2021/06/19 15:53, Dan Carpenter wrote:
> > The nfp_fl_ct_add_flow() function can fail so we need to check for
> > failure.
> > 
> > Fixes: 95255017e0a8 ("nfp: flower-ct: add nft flows to nft list")
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> Ah, of course, thank you.
> Reviewed-by: Louis Peens <louis.peens@corigine.com>

Likewise, thanks.

Reviewed-by: Simon Horman <simon.horman@corigine.com>
patchwork-bot+netdevbpf@kernel.org June 21, 2021, 7:30 p.m. UTC | #3
Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Sat, 19 Jun 2021 16:53:26 +0300 you wrote:
> The nfp_fl_ct_add_flow() function can fail so we need to check for
> failure.
> 
> Fixes: 95255017e0a8 ("nfp: flower-ct: add nft flows to nft list")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/net/ethernet/netronome/nfp/flower/conntrack.c | 2 ++
>  1 file changed, 2 insertions(+)

Here is the summary with links:
  - [net-next] nfp: flower-ct: check for error in nfp_fl_ct_offload_nft_flow()
    https://git.kernel.org/netdev/net-next/c/43c9a8111680

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
diff mbox series

Patch

diff --git a/drivers/net/ethernet/netronome/nfp/flower/conntrack.c b/drivers/net/ethernet/netronome/nfp/flower/conntrack.c
index 9ea77bb3b69c..273d529d43c2 100644
--- a/drivers/net/ethernet/netronome/nfp/flower/conntrack.c
+++ b/drivers/net/ethernet/netronome/nfp/flower/conntrack.c
@@ -1067,6 +1067,8 @@  nfp_fl_ct_offload_nft_flow(struct nfp_fl_ct_zone_entry *zt, struct flow_cls_offl
 						    nfp_ct_map_params);
 		if (!ct_map_ent) {
 			ct_entry = nfp_fl_ct_add_flow(zt, NULL, flow, true, extack);
+			if (IS_ERR(ct_entry))
+				return PTR_ERR(ct_entry);
 			ct_entry->type = CT_TYPE_NFT;
 			list_add(&ct_entry->list_node, &zt->nft_flows_list);
 			zt->nft_flows_count++;