misc: sram: enable clock before registering regions
authorJohan Hovold <johan@kernel.org>
Tue, 3 Jul 2018 10:05:48 +0000 (12:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Oct 2018 00:00:46 +0000 (17:00 -0700)
commit0470189cd9b931a4a22e2d179a788abc47f6e7fc
tree98340d6dd1f353a58ca34644865108e46e800a4a
parent914b4daa9b6d00b520e136e5a10f5286b4d211f3
misc: sram: enable clock before registering regions

[ Upstream commit d5b9653dd2bb7a2b1c8cc783c5d3b607bbb6b271 ]

Make sure to enable the clock before registering regions and exporting
partitions to user space at which point we must be prepared for I/O.

Fixes: ee895ccdf776 ("misc: sram: fix enabled clock leak on error path")
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/sram.c