Skip to content

Commit

Permalink
RTC: Release mutex in error path of rtc_alarm_irq_enable
Browse files Browse the repository at this point in the history
On hardware that doesn't support alarm interrupts, rtc_alarm_irq_enable
could return without releasing the ops_lock mutex.

This was introduced in
	aa0be0f (RTC: Propagate error handling via rtc_timer_enqueue properly)

This patch corrects the issue by only returning once the mutex is
released.

[john.stultz: Reworded the commit log]

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: John Stultz <john.stultz@linaro.org>
  • Loading branch information
Uwe Kleine-König authored and John Stultz committed Feb 17, 2011
1 parent d8ce148 commit 516373b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/rtc/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,8 @@ int rtc_alarm_irq_enable(struct rtc_device *rtc, unsigned int enabled)
}

if (err)
return err;

if (!rtc->ops)
/* nothing */;
else if (!rtc->ops)
err = -ENODEV;
else if (!rtc->ops->alarm_irq_enable)
err = -EINVAL;
Expand Down

0 comments on commit 516373b

Please sign in to comment.