Skip to content

Commit

Permalink
nfp: flower: correction of error handling
Browse files Browse the repository at this point in the history
Removing reduplicated error handling when running into error path
of `nfp_compile_flow_metadata`.

Signed-off-by: Yu Xiao <[email protected]>
Signed-off-by: Yinjun Zhang <[email protected]>
Signed-off-by: Simon Horman <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
macris-xiao authored and davem330 committed Nov 19, 2021
1 parent 812ad3d commit eaa54d6
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions drivers/net/ethernet/netronome/nfp/flower/metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,6 @@ int nfp_compile_flow_metadata(struct nfp_app *app, u32 cookie,
nfp_flow->meta.mask_len,
&nfp_flow->meta.flags, &new_mask_id)) {
NL_SET_ERR_MSG_MOD(extack, "invalid entry: cannot allocate a new mask id");
if (nfp_release_stats_entry(app, stats_cxt)) {
NL_SET_ERR_MSG_MOD(extack, "invalid entry: cannot release stats context");
err = -EINVAL;
goto err_remove_rhash;
}
err = -ENOENT;
goto err_remove_rhash;
}
Expand All @@ -359,21 +354,6 @@ int nfp_compile_flow_metadata(struct nfp_app *app, u32 cookie,
check_entry = nfp_flower_search_fl_table(app, cookie, netdev);
if (check_entry) {
NL_SET_ERR_MSG_MOD(extack, "invalid entry: cannot offload duplicate flow entry");
if (nfp_release_stats_entry(app, stats_cxt)) {
NL_SET_ERR_MSG_MOD(extack, "invalid entry: cannot release stats context");
err = -EINVAL;
goto err_remove_mask;
}

if (!nfp_flow->pre_tun_rule.dev &&
!nfp_check_mask_remove(app, nfp_flow->mask_data,
nfp_flow->meta.mask_len,
NULL, &new_mask_id)) {
NL_SET_ERR_MSG_MOD(extack, "invalid entry: cannot release mask id");
err = -EINVAL;
goto err_remove_mask;
}

err = -EEXIST;
goto err_remove_mask;
}
Expand Down

0 comments on commit eaa54d6

Please sign in to comment.