mirror of
https://github.com/torvalds/linux.git
synced 2026-03-14 02:06:15 +01:00
HSI: omap_ssi_core: fix possible memory leak in ssi_probe()
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: b209e047bc ("HSI: Introduce OMAP SSI driver")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
parent
f5181c35ed
commit
1aff514e1d
1 changed files with 3 additions and 1 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue