Explorar o código

[PATCH] rtc: fix idr locking

We need to serialize access to the global rtc_idr even in this error path.

Signed-off-by: Sonny Rao <sonny@burdell.org>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Sonny Rao %!s(int64=19) %!d(string=hai) anos
pai
achega
6ac12dfe9c
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      drivers/rtc/class.c

+ 2 - 0
drivers/rtc/class.c

@@ -94,7 +94,9 @@ exit_kfree:
 	kfree(rtc);
 
 exit_idr:
+	mutex_lock(&idr_lock);
 	idr_remove(&rtc_idr, id);
+	mutex_unlock(&idr_lock);
 
 exit:
 	dev_err(dev, "rtc core: unable to register %s, err = %d\n",