net/mlx5: Remove NULL check before dev_{put, hold}
authorYang Li <yang.lee@linux.alibaba.com>
Wed, 22 Feb 2023 02:29:44 +0000 (10:29 +0800)
committerSaeed Mahameed <saeedm@nvidia.com>
Fri, 24 Feb 2023 18:13:18 +0000 (10:13 -0800)
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 <abaci@linux.alibaba.com>
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4174
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c

index e24b469..8f7452d 100644 (file)
@@ -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;