HSI: omap_ssi_core: fix possible memory leak in ssi_probe()
PATCH 1/1 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 b209e047bc74 ("HSI: Introduce OMAP SSI driver")
Signed-off-by Yang Yingliang <[email protected]>
--- drivers/hsi/controllers/omap_ssi_core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/hsi/controllers/omap_ssi_core.c +3 -1
@@ -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);
Signature · 1 line
2.25.1
Hi,
Quoted 8 lines · Yang Yingliang
If
ssi_add_controller()returns error, it should callhsi_put_controller()to give up the reference that was set inhsi_alloc_controller(), so that it can callhsi_controller_release()to free controller and ports that allocated inhsi_alloc_controller().Fixes b209e047bc74 ("HSI: Introduce OMAP SSI driver")Signed-off-by Yang Yingliang <[email protected]>---
Thanks, queued.
-- Sebastian
Quoted 22 lines
drivers/hsi/controllers/omap_ssi_core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/hsi/controllers/omap_ssi_core.c +3
-1@@ -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);Signature · 1 line
2.25.1