net/mlx5: fix the error set in quota init
PATCH 2/7 net/mlx5: fix the error set in quota init
When there was a failure in the quota initialization, only the return value was set. The "rte_errno" and the "rte_flow_error" were not set. The application may get a crash when trying to access the "message" field.
Fixes 15896eaf9d71 ("net/mlx5: support indirect quota create/query/modify")
Signed-off-by Bing Zhao <[email protected]>
Acked-by Ori Kam <[email protected]>
--- drivers/net/mlx5/mlx5_flow_hw.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/mlx5/mlx5_flow_hw.c +4 -1
@@ -7789,8 +7789,11 @@ flow_hw_configure(struct rte_eth_dev *dev,/* Initialize quotas */ if (port_attr->nb_quotas) { ret =mlx5_flow_quota_init (dev, port_attr->nb_quotas); -if (ret) +if (ret) { +rte_flow_error_set (error, -ret,RTE_FLOW_ERROR_TYPE_UNSPECIFIED ,NULL , +"Failed to initialize quota." ); goto err; + } }/* Initialize meter library*/ if (port_attr->nb_meters || (host_priv && host_priv->hws_mpool))
Signature · 1 line
2.34.1