]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
sparc64: Add missing rtc_close() in update_persistent_clock()
authorDavid S. Miller <davem@davemloft.net>
Tue, 9 Sep 2008 02:53:28 +0000 (19:53 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 9 Sep 2008 02:53:28 +0000 (19:53 -0700)
Noticed by David Brownell.

Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc64/kernel/time.c

index 226a0042d870631dca3f670a5485bde01d692ce9..8a2fa0eb66029a83a3f0dfb9fa36f62ddb0ede65 100644 (file)
@@ -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;
 }