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

Louis Peens
2021-06-21T05:15:24Z

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++;
>