]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
RDMA/core: Avoid freeing netdevs in disable_device()
authorParav Pandit <parav@mellanox.com>
Mon, 15 Apr 2019 10:22:49 +0000 (13:22 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 22 Apr 2019 17:44:58 +0000 (14:44 -0300)
So we can use the disable_device() helper while changing the net namespace
of the rdma device in a subsequent patch, move free_netdevs() out of it.

Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/device.c

index 88c4238bbee133a29430be92fbe696fe87205df1..25f49b64600723e6aeb3359f3c2d5b6f517b6d64 100644 (file)
@@ -1152,9 +1152,6 @@ static void disable_device(struct ib_device *device)
         * devices and before device is disabled.
         */
        remove_compat_devs(device);
-
-       /* Expedite removing unregistered pointers from the hash table */
-       free_netdevs(device);
 }
 
 /*
@@ -1297,6 +1294,10 @@ static void __ib_unregister_device(struct ib_device *ib_dev)
                goto out;
 
        disable_device(ib_dev);
+
+       /* Expedite removing unregistered pointers from the hash table */
+       free_netdevs(ib_dev);
+
        ib_device_unregister_sysfs(ib_dev);
        device_del(&ib_dev->dev);
        ib_device_unregister_rdmacg(ib_dev);