Skip to content

Commit 1aff514

Browse files
Yang Yingliangsre
authored andcommitted
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: b209e04 ("HSI: Introduce OMAP SSI driver") Signed-off-by: Yang Yingliang <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
1 parent f5181c3 commit 1aff514

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/hsi/controllers/omap_ssi_core.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,8 +502,10 @@ static int ssi_probe(struct platform_device *pd)
502502
platform_set_drvdata(pd, ssi);
503503

504504
err = ssi_add_controller(ssi, pd);
505-
if (err < 0)
505+
if (err < 0) {
506+
hsi_put_controller(ssi);
506507
goto out1;
508+
}
507509

508510
pm_runtime_enable(&pd->dev);
509511

0 commit comments

Comments
 (0)