]> git.baikalelectronics.ru Git - kernel.git/commit
misc: sram: fix resource leaks in probe error path
authorJohan Hovold <johan@kernel.org>
Tue, 3 Jul 2018 10:05:47 +0000 (12:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Jul 2018 14:48:15 +0000 (16:48 +0200)
commitb1d3003586b94f19921ccde0d44f6e17663a29f2
tree5b832d2f3b5acce75c164b63a9276955c917518d
parent6068ae12b2c695b2ae2e0aeba39934f4ff78aa32
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 b7857583e0b5 ("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.

Fixes: 27d3d6acc16e ("misc: sram: add Atmel securam support")
Cc: stable <stable@vger.kernel.org> # 4.9
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/sram.c