RDMA/core: Follow correct unregister order between sysfs and cgroup
authorParav Pandit <parav@mellanox.com>
Thu, 6 Sep 2018 07:55:31 +0000 (10:55 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 6 Sep 2018 20:32:21 +0000 (14:32 -0600)
During register_device() init sequence is,
(a) register with rdma cgroup followed by
(b) register with sysfs

Therefore, unregister_device() sequence should follow the reverse order.

Signed-off-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Daniel Jurgens <danielj@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/device.c

index a093914..e115506 100644 (file)
@@ -598,8 +598,8 @@ void ib_unregister_device(struct ib_device *device)
        }
        up_read(&lists_rwsem);
 
-       ib_device_unregister_rdmacg(device);
        ib_device_unregister_sysfs(device);
+       ib_device_unregister_rdmacg(device);
 
        mutex_unlock(&device_mutex);