From: Sonny Rao Date: Tue, 27 Jun 2006 09:54:06 +0000 (-0700) Subject: [PATCH] rtc: fix idr locking X-Git-Tag: v2.6.18-rc1~544 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ac12dfe9c2027cd3c5ed603f11d1bb4f04906fe;p=linux-2.6 [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 Acked-by: Alessandro Zummo Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c index 5396beec30..1cb61a761c 100644 --- a/drivers/rtc/class.c +++ b/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",