mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
rtc: fix double lock on UIE emulation
With commit 5ad31a5751 ("rtc: remove BKL
for ioctl()"), RTC_UIE_ON ioctl cause double lock on rtc->ops_lock.
The ops_lock must not be held while set_uie() calls rtc_read_time()
which takes the lock. Also clear_uie() does not need ops_lock. This
patch fixes return value of RTC_UIE_OFF ioctl too.
Signed-off-by: Atsushi Nemoto <[email protected]>
Cc: David Brownell <[email protected]>
Cc: Russell King <[email protected]>
Cc: Alessandro Zummo <[email protected]>
Cc: "Rafael J. Wysocki" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
ff9bc512f1
commit
1d96469a34
1 changed files with 4 additions and 1 deletions
|
|
@ -403,11 +403,14 @@ static long rtc_dev_ioctl(struct file *file,
|
|||
|
||||
#ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL
|
||||
case RTC_UIE_OFF:
|
||||
mutex_unlock(&rtc->ops_lock);
|
||||
clear_uie(rtc);
|
||||
break;
|
||||
return 0;
|
||||
|
||||
case RTC_UIE_ON:
|
||||
mutex_unlock(&rtc->ops_lock);
|
||||
err = set_uie(rtc);
|
||||
return err;
|
||||
#endif
|
||||
default:
|
||||
err = -ENOTTY;
|
||||
|
|
|
|||
Loading…
Reference in a new issue