+ rtc-fix-double-lock-on-uie-emulation.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     rtc: fix double lock on UIE emulation
has been added to the -mm tree.  Its filename is
     rtc-fix-double-lock-on-uie-emulation.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: rtc: fix double lock on UIE emulation
From: Atsushi Nemoto <anemo@xxxxxxxxxxxxx>
		
With commit 5ad31a575157147b43fa84ef1e21471661653878 ("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 <anemo@xxxxxxxxxxxxx>
Cc: David Brownell <david-b@xxxxxxxxxxx>
Cc: Russell King <rmk@xxxxxxxxxxxxxxxx>
Cc: Alessandro Zummo <a.zummo@xxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/rtc/rtc-dev.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff -puN drivers/rtc/rtc-dev.c~rtc-fix-double-lock-on-uie-emulation drivers/rtc/rtc-dev.c
--- a/drivers/rtc/rtc-dev.c~rtc-fix-double-lock-on-uie-emulation
+++ a/drivers/rtc/rtc-dev.c
@@ -403,11 +403,14 @@ static long rtc_dev_ioctl(struct file *f
 
 #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;
_

Patches currently in -mm which might be from anemo@xxxxxxxxxxxxx are

rtc-fix-double-lock-on-uie-emulation.patch
cramfs-fix-named-pipe-handling.patch
linux-next.patch
rtc-file-close-consistently-disables-repeating-irqs.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux