Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ef87ed9a authored by Yang Yingliang's avatar Yang Yingliang Committed by Greg Kroah-Hartman
Browse files

HSI: omap_ssi_core: fix possible memory leak in ssi_probe()



[ Upstream commit 1aff514e1d2bd47854dbbdf867970b9d463d4c57 ]

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: b209e047 ("HSI: Introduce OMAP SSI driver")
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent e9a32f75
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -502,8 +502,10 @@ static int ssi_probe(struct platform_device *pd)
	platform_set_drvdata(pd, ssi);

	err = ssi_add_controller(ssi, pd);
	if (err < 0)
	if (err < 0) {
		hsi_put_controller(ssi);
		goto out1;
	}

	pm_runtime_enable(&pd->dev);