Message ID | 20240424121632.459022-4-ast@fiberby.net (mailing list archive) |
---|---|
State | Accepted |
Commit | b92eb1ac13f069f188b733709afabc26049bf6bf |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: sparx5: flower: validate control flags | expand |
diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c b/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c index d0dca65f8e76..22f6c778afb0 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c @@ -191,17 +191,15 @@ sparx5_tc_flower_handler_control_usage(struct vcap_tc_flower_parse_usage *st) err = vcap_rule_add_key_u32(st->vrule, VCAP_KF_L3_FRAGMENT_TYPE, value, mask); - if (err) - goto out; + if (err) { + NL_SET_ERR_MSG_MOD(extack, "ip_frag parse error"); + return err; + } } st->used_keys |= BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL); return err; - -out: - NL_SET_ERR_MSG_MOD(extack, "ip_frag parse error"); - return err; } static int
Remove goto, as it's only used once, and the error message is specific to that context. Only compile tested. Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net> --- .../net/ethernet/microchip/sparx5/sparx5_tc_flower.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)