net/mlx5e: Fix mlx5e_tx_reporter_create return value
authorEran Ben Elisha <eranbe@mellanox.com>
Wed, 20 Feb 2019 10:33:01 +0000 (12:33 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 22 Feb 2019 21:38:24 +0000 (13:38 -0800)
If reporter is ERR_PTR or NULL, error code shall be returned. At all other
cases it shall return success. Fix that.

Fixes: de8650a82071 ("net/mlx5e: Add tx reporter support")
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c

index 627392bead3b852ccd5108d63d48bd09b2a30308..75dad8797720ed23bf2c45b694f82c104b926808 100644 (file)
@@ -297,7 +297,7 @@ int mlx5e_tx_reporter_create(struct mlx5e_priv *priv)
                netdev_warn(priv->netdev,
                            "Failed to create tx reporter, err = %ld\n",
                            PTR_ERR(priv->tx_reporter));
-       return PTR_ERR_OR_ZERO(priv->tx_reporter);
+       return IS_ERR_OR_NULL(priv->tx_reporter);
 }
 
 void mlx5e_tx_reporter_destroy(struct mlx5e_priv *priv)