Skip to content

Commit

Permalink
sparc64: Add missing rtc_close() in update_persistent_clock()
Browse files Browse the repository at this point in the history
Noticed by David Brownell.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Sep 9, 2008
1 parent 7b1af32 commit 088a396
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions arch/sparc64/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 088a396

Please sign in to comment.