From 85a9c42499fa97b9bee12a95a8477d34cec277ec Mon Sep 17 00:00:00 2001 From: Ivan Malov Date: Fri, 26 Mar 2021 12:39:27 +0300 Subject: [PATCH] net/sfc: fix error path inconsistency At the fail label, there's a statement to set general errno and error message. However, before the label is reached, a custom error message can be set by the code which parses actions. This custom (action-specific) message, when present, must not be replaced by the general one. Fixes: 662286ae61d2 ("net/sfc: add actions parsing stub to MAE backend") Cc: stable@dpdk.org Signed-off-by: Ivan Malov Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- drivers/net/sfc/sfc_mae.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c index 8afa093414..4dafe3dcd9 100644 --- a/drivers/net/sfc/sfc_mae.c +++ b/drivers/net/sfc/sfc_mae.c @@ -2634,6 +2634,8 @@ sfc_mae_rule_parse_actions(struct sfc_adapter *sa, efx_mae_actions_t *spec; int rc; + rte_errno = 0; + if (actions == NULL) { return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION_NUM, NULL, @@ -2690,7 +2692,7 @@ fail_rule_parse_action: efx_mae_action_set_spec_fini(sa->nic, spec); fail_action_set_spec_init: - if (rc > 0) { + if (rc > 0 && rte_errno == 0) { rc = rte_flow_error_set(error, rc, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, "Failed to process the action"); -- 2.20.1