net/mlx5e: free page before return
authorPan Bian <bianpan2016@163.com>
Thu, 21 Jan 2021 04:58:30 +0000 (20:58 -0800)
committerSaeed Mahameed <saeedm@nvidia.com>
Tue, 26 Jan 2021 23:38:41 +0000 (15:38 -0800)
Instead of directly return, goto the error handling label to free
allocated page.

Fixes: 5f29458b77d5 ("net/mlx5e: Support dump callback in TX reporter")
Signed-off-by: Pan Bian <bianpan2016@163.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en/health.c

index 718f8c0a4f6b7cc695ccac7aac245e2776a01fca..84e501e057b4f97aa736a7ee64fff10c34d0e7bc 100644 (file)
@@ -273,7 +273,7 @@ int mlx5e_health_rsc_fmsg_dump(struct mlx5e_priv *priv, struct mlx5_rsc_key *key
 
        err = devlink_fmsg_binary_pair_nest_start(fmsg, "data");
        if (err)
-               return err;
+               goto free_page;
 
        cmd = mlx5_rsc_dump_cmd_create(mdev, key);
        if (IS_ERR(cmd)) {