IB/core: Fix missing RDMA cgroups release in case of failure to register device
authorParav Pandit <parav@mellanox.com>
Sun, 25 Feb 2018 11:39:56 +0000 (13:39 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Mar 2018 09:54:33 +0000 (10:54 +0100)
commite3a8c7b5d70760f56aef564a5ac17115cfc0b5f5
tree31086aac78bc432d4c786fca07fac963dcb3654a
parentc1badd7b65c41b4742a9719b13be623fc3cfdcaf
IB/core: Fix missing RDMA cgroups release in case of failure to register device

commit 2fb4f4eadd180a50112618dd9c5fef7fc50d4f08 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/core/device.c