Commit eaa54d66 authored by Yu Xiao's avatar Yu Xiao Committed by David S. Miller

nfp: flower: correction of error handling

Removing reduplicated error handling when running into error path
of `nfp_compile_flow_metadata`.
Signed-off-by: default avatarYu Xiao <yu.xiao@corigine.com>
Signed-off-by: default avatarYinjun Zhang <yinjun.zhang@corigine.com>
Signed-off-by: default avatarSimon Horman <simon.horman@corigine.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 812ad3d2
......@@ -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;
}
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment