patch "misc: sram: fix resource leaks in probe error path" added to char-misc-testing
Subsystems (2)
This is a note to let you know that I've just added the patch titled
misc: sram: fix resource leaks in probe error path
to my char-misc git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
in the char-misc-testing branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will be merged to the char-misc-next branch sometime soon, after it passes testing, and the merge window is open.
If you have any questions about this process, please let me know.
Quoted 1 line
From
f294d00961d1d869ecffa60e280eeeee1ccf9a49Mon Sep 17 00:00:00 2001
From: Johan Hovold <[email protected]>
Date: Tue, 3 Jul 2018 12:05:47 +0200
Subject: misc: sram: fix resource leaks in probe error path
Make sure to disable clocks and deregister any exported partitions before returning on late probe errors.
Note that since commit ee895ccdf776 ("misc: sram: fix enabled clock leak on error path"), partitions are deliberately exported before enabling the clock so we stick to that logic here. A follow up patch will address this.
--- drivers/misc/sram.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/misc/sram.c +8 -1
@@ -407,13 +407,20 @@ static int sram_probe(struct platform_device *pdev)if (init_func) { ret =init_func ();if (ret) -return ret; + goto err_disable_clk; }dev_dbg (sram->dev,"SRAM pool: %zu KiB @ 0x%p\n" ,gen_pool_size (sram->pool) /1024 , sram->virt_base);return 0 ; + +err_disable_clk: +if (sram->clk) +clk_disable_unprepare (sram->clk); +sram_free_partitions (sram); + +return ret; }static int sram_remove (struct platform_device *pdev)
Signature · 1 line
2.18.0