]> git.baikalelectronics.ru Git - kernel.git/commit
HSI: omap_ssi_core: fix possible memory leak in ssi_probe()
authorYang Yingliang <yangyingliang@huawei.com>
Mon, 31 Oct 2022 07:43:37 +0000 (15:43 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:44 +0000 (13:32 +0100)
commitc8f5d53520bdd7cc13c6091c9ff259bbf2c6d780
tree837a3532ef763fe733857472c222c8bd6f689215
parent3516be4defbecdefd9f76291cbf2a58e88c5866a
HSI: omap_ssi_core: fix possible memory leak in ssi_probe()

[ Upstream commit af0fa6f0a81585950178a468a0d1a177159c2ce3 ]

If ssi_add_controller() returns error, it should call hsi_put_controller()
to give up the reference that was set in hsi_alloc_controller(), so that
it can call hsi_controller_release() to free controller and ports that
allocated in hsi_alloc_controller().

Fixes: 89e89c8124a2 ("HSI: Introduce OMAP SSI driver")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hsi/controllers/omap_ssi_core.c