mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sonny Rao <sonny@burdell.org>
To: linux-kernel@vger.kernel.org, akpm@osdl.org
Cc: a.zummo@towertech.it
Subject: [PATCH] fix idr locking in rtc class
Date: Mon, 26 Jun 2006 20:19:51 -0400	[thread overview]
Message-ID: <20060627001951.GA24726@kevlar.burdell.org> (raw)

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

Signed-off-by: Sonny Rao <sonny@burdell.org>

--- linux-2.6.17/drivers/rtc/class.c~orig	2006-06-26 19:10:44.738511816 -0500
+++ linux-2.6.17/drivers/rtc/class.c	2006-06-26 19:12:22.008724496 -0500
@@ -93,7 +93,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",

             reply	other threads:[~2006-06-27  0:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-27  0:19 Sonny Rao [this message]
2006-06-27  6:55 ` Alessandro Zummo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060627001951.GA24726@kevlar.burdell.org \
    --to=sonny@burdell.org \
    --cc=a.zummo@towertech.it \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®