]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/iwcm: Release resources if iw_cm module initialization fails
authorLeon Romanovsky <leonro@nvidia.com>
Fri, 23 Jul 2021 14:08:55 +0000 (17:08 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Sep 2021 10:26:23 +0000 (12:26 +0200)
commitaf2c0c29acccfae2e1e6da651e0232f2e551499c
tree551a9a58951670cb08c88e128348f0cc3a46ef1b
parent0b3ed2709ad654390457bb3429bbe69eb4476306
RDMA/iwcm: Release resources if iw_cm module initialization fails

[ Upstream commit e677b72a0647249370f2635862bf0241c86f66ad ]

The failure during iw_cm module initialization partially left the system
with unreleased memory and other resources. Rewrite the module init/exit
routines in such way that netlink commands will be opened only after
successful initialization.

Fixes: 5c0f00dad781 ("iwcm: common code for port mapper")
Link: https://lore.kernel.org/r/b01239f99cb1a3e6d2b0694c242d89e6410bcd93.1627048781.git.leonro@nvidia.com
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/core/iwcm.c