Skip to content

Commit 0483a16

Browse files
Yang LiSaeed Mahameed
authored andcommitted
net/mlx5: Remove NULL check before dev_{put, hold}
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 <[email protected]> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4174 Signed-off-by: Yang Li <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent ac3ad19 commit 0483a16

File tree

1 file changed

+1
-2
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/en/rep

1 file changed

+1
-2
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -710,8 +710,7 @@ void mlx5e_rep_tc_receive(struct mlx5_cqe64 *cqe, struct mlx5e_rq *rq,
710710
else
711711
napi_gro_receive(rq->cq.napi, skb);
712712

713-
if (tc_priv.fwd_dev)
714-
dev_put(tc_priv.fwd_dev);
713+
dev_put(tc_priv.fwd_dev);
715714

716715
return;
717716

0 commit comments

Comments
 (0)