mctp: Fix an error handling path in mctp_init()
authorWei Yongjun <weiyongjun1@huawei.com>
Tue, 8 Nov 2022 09:55:17 +0000 (09:55 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Nov 2022 08:58:22 +0000 (09:58 +0100)
commit49d8a6e24a3496d86e8d8ae748375df984fb6d6f
tree3816a18620b036dbc2c17d35f9220940e77ecac1
parent29961d2332a5b9a7addc485cb930c46fecc5255f
mctp: Fix an error handling path in mctp_init()

[ Upstream commit d4072058af4fd8fb4658e7452289042a406a9398 ]

If mctp_neigh_init() return error, the routes resources should
be released in the error handling path. Otherwise some resources
leak.

Fixes: 4d8b9319282a ("mctp: Add neighbour implementation")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Matt Johnston <matt@codeconstruct.com.au>
Link: https://lore.kernel.org/r/20221108095517.620115-1-weiyongjun@huaweicloud.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/mctp/af_mctp.c
net/mctp/route.c