Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <yangyingliang@huawei.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

authored by

Yang Yingliang and committed by
Sebastian Reichel
1aff514e f5181c35

+3 -1
+3 -1
drivers/hsi/controllers/omap_ssi_core.c
··· 502 502 platform_set_drvdata(pd, ssi); 503 503 504 504 err = ssi_add_controller(ssi, pd); 505 - if (err < 0) 505 + if (err < 0) { 506 + hsi_put_controller(ssi); 506 507 goto out1; 508 + } 507 509 508 510 pm_runtime_enable(&pd->dev); 509 511