]> www.infradead.org Git - users/dwmw2/linux.git/commit
rtc: mc13xxx: fix a double-unlock issue
authorQiushi Wu <wu000273@umn.edu>
Sun, 3 May 2020 18:22:35 +0000 (13:22 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jun 2020 15:48:21 +0000 (17:48 +0200)
commit4d08eb5071407265108753ac6d89b4fc72f18a7b
tree25460579b38d40948755765b6896c6167cf0be6c
parentddaa88123713429ae836c65515a79cd49d59aa84
rtc: mc13xxx: fix a double-unlock issue

[ Upstream commit 8816cd726a4fee197af2d851cbe25991ae19ea14 ]

In function mc13xxx_rtc_probe, the mc13xxx_unlock() is called
before rtc_register_device(). But in the error path of
rtc_register_device(), the mc13xxx_unlock() is called again,
which causes a double-unlock problem. Thus add a call of the
function “mc13xxx_lock” in an if branch for the completion
of the exception handling.

Fixes: e4ae7023e182a ("rtc: mc13xxx: set range")
Signed-off-by: Qiushi Wu <wu000273@umn.edu>
Link: https://lore.kernel.org/r/20200503182235.1652-1-wu000273@umn.edu
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/rtc/rtc-mc13xxx.c