From 0483a16bc493075bb9f6483497786fed41d27b94 Mon Sep 17 00:00:00 2001 From: Yang Li Date: Wed, 22 Feb 2023 10:29:44 +0800 Subject: [PATCH] net/mlx5: Remove NULL check before dev_{put, hold} MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The call netdev_{put, hold} of dev_{put, hold} will check NULL, so there is no need to check before using dev_{put, hold}, remove it to silence the warning: ./drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c:714:2-9: WARNING: NULL check before dev_{put, hold} functions is not needed. Reported-by: Abaci Robot Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4174 Signed-off-by: Yang Li Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c index e24b4695..8f7452d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c @@ -710,8 +710,7 @@ forward: else napi_gro_receive(rq->cq.napi, skb); - if (tc_priv.fwd_dev) - dev_put(tc_priv.fwd_dev); + dev_put(tc_priv.fwd_dev); return; -- 2.7.4