On Mon, Apr 16, 2018 at 06:21:48PM +0200, Adrien Mazarguil wrote:
> When memory cannot be allocated for a flow rule, its RSS context reference
> is not dropped.
>
> Fixes: 078b8b452e6b ("net/mlx4: add RSS flow rule action support")
> Cc: [email protected]
>
> Signed-off-by: Adrien Mazarguil <[email protected]>
> Cc: Shahaf Shuler <[email protected]>
Acked-by: Nelio Laranjeiro <[email protected]>
> ---
> drivers/net/mlx4/mlx4_flow.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c
> index f3063ee8a..2b4bf7094 100644
> --- a/drivers/net/mlx4/mlx4_flow.c
> +++ b/drivers/net/mlx4/mlx4_flow.c
> @@ -820,11 +820,14 @@ mlx4_flow_prepare(struct priv *priv,
> },
> };
>
> - if (!mlx4_zmallocv(__func__, vec, RTE_DIM(vec)))
> + if (!mlx4_zmallocv(__func__, vec, RTE_DIM(vec))) {
> + if (temp.rss)
> + mlx4_rss_put(temp.rss);
> return rte_flow_error_set
> (error, -rte_errno,
> RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
> "flow rule handle allocation failure");
> + }
> /* Most fields will be updated by second pass. */
> *flow = (struct rte_flow){
> .ibv_attr = temp.ibv_attr,
> --
> 2.11.0
--
Nélio Laranjeiro
6WIND