diff options
author | Jules Irenge <jbi.octave@gmail.com> | 2024-05-01 02:46:42 +0300 |
---|---|---|
committer | Leon Romanovsky <leon@kernel.org> | 2024-05-02 17:45:59 +0300 |
commit | 82e966130ddd67539ab904f2038e7bf5d4a66247 (patch) | |
tree | 6a3ffdf4202ce1f652238465f27ab48c5fe44f84 /drivers/infiniband | |
parent | fd3af5e21866b776713b8c60556153d758995fb7 (diff) | |
download | linux-82e966130ddd67539ab904f2038e7bf5d4a66247.tar.xz |
RDMA/mlx5: Remove NULL check before dev_{put, hold}
Coccinelle reports a warning
WARNING: NULL check before dev_{put, hold} functions is not needed
The reason is the call netdev_{put, hold} of dev_{put,hold} will check NULL
There is no need to check before using dev_{put, hold}
Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Link: https://lore.kernel.org/r/ZjGC4qXrOwZE0aHi@octinomon.home
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/mlx5/main.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index c2b557e64290..2366c46eebc8 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -264,8 +264,7 @@ static struct net_device *mlx5_ib_get_netdev(struct ib_device *device, */ read_lock(&ibdev->port[port_num - 1].roce.netdev_lock); ndev = ibdev->port[port_num - 1].roce.netdev; - if (ndev) - dev_hold(ndev); + dev_hold(ndev); read_unlock(&ibdev->port[port_num - 1].roce.netdev_lock); out: |