From: David S. Miller Date: Tue, 9 Sep 2008 02:53:28 +0000 (-0700) Subject: sparc64: Add missing rtc_close() in update_persistent_clock() X-Git-Tag: firefly_0821_release~17814^2~50 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=088a39623660f2875aaf15649bf663bbb5a8a219;p=firefly-linux-kernel-4.4.55.git sparc64: Add missing rtc_close() in update_persistent_clock() Noticed by David Brownell. Signed-off-by: David S. Miller --- diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c index 226a0042d870..8a2fa0eb6602 100644 --- a/arch/sparc64/kernel/time.c +++ b/arch/sparc64/kernel/time.c @@ -396,9 +396,12 @@ static unsigned long timer_ticks_per_nsec_quotient __read_mostly; int update_persistent_clock(struct timespec now) { struct rtc_device *rtc = rtc_class_open("rtc0"); + int err; - if (rtc) - return rtc_set_mmss(rtc, now.tv_sec); + if (rtc) { + err = rtc_set_mmss(rtc, now.tv_sec); + rtc_class_close(rtc); + } return -1; }