mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 23:22:31 +02:00
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>
This commit is contained in:
parent
fd3af5e218
commit
82e966130d
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user