OSDN Git Service

net/mlx5: Remove redundant check
authorLeon Romanovsky <leonro@nvidia.com>
Thu, 13 Oct 2022 12:48:43 +0000 (15:48 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Wed, 30 Nov 2022 05:09:47 +0000 (21:09 -0800)
If ASO failed in creation, it won't be called to destroy either.
The kernel coding pattern is to make sure that callers are calling
to destroy only for valid objects.

Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/lib/aso.c

index c971ff0..0f9e4f0 100644 (file)
@@ -334,9 +334,6 @@ err_cq:
 
 void mlx5_aso_destroy(struct mlx5_aso *aso)
 {
-       if (IS_ERR_OR_NULL(aso))
-               return;
-
        mlx5_aso_destroy_sq(aso);
        mlx5_aso_destroy_cq(&aso->cq);
        kfree(aso);