diff options
author | Parav Pandit <parav@mellanox.com> | 2018-02-25 13:39:56 +0200 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-02-28 12:10:32 -0700 |
commit | 2fb4f4eadd180a50112618dd9c5fef7fc50d4f08 (patch) | |
tree | c10ceb65609ea83653be50e6548afa212b425902 /drivers/infiniband | |
parent | 65389322b28f81cc137b60a41044c2d958a7b950 (diff) | |
download | linux-stable-2fb4f4eadd180a50112618dd9c5fef7fc50d4f08.tar.gz linux-stable-2fb4f4eadd180a50112618dd9c5fef7fc50d4f08.tar.bz2 linux-stable-2fb4f4eadd180a50112618dd9c5fef7fc50d4f08.zip |
IB/core: Fix missing RDMA cgroups release in case of failure to register device
During IB device registration process, if query_device() fails or if
ib_core fails to registers sysfs entries, rdma cgroup cleanup is
skipped.
Cc: <stable@vger.kernel.org> # v4.2+
Fixes: 4be3a4fa51f4 ("IB/core: Fix kernel crash during fail to initialize device")
Reviewed-by: Daniel Jurgens <danielj@mellanox.com>
Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/core/device.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c index e8010e73a1cf..bb065c9449be 100644 --- a/drivers/infiniband/core/device.c +++ b/drivers/infiniband/core/device.c @@ -536,14 +536,14 @@ int ib_register_device(struct ib_device *device, ret = device->query_device(device, &device->attrs, &uhw); if (ret) { pr_warn("Couldn't query the device attributes\n"); - goto cache_cleanup; + goto cg_cleanup; } ret = ib_device_register_sysfs(device, port_callback); if (ret) { pr_warn("Couldn't register device %s with driver model\n", device->name); - goto cache_cleanup; + goto cg_cleanup; } device->reg_state = IB_DEV_REGISTERED; @@ -559,6 +559,8 @@ int ib_register_device(struct ib_device *device, mutex_unlock(&device_mutex); return 0; +cg_cleanup: + ib_device_unregister_rdmacg(device); cache_cleanup: ib_cache_cleanup_one(device); ib_cache_release_one(device); |