All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Neukum <oliver@neukum.org>
To: Robert Schwebel <robert@schwebel.de>
Cc: John Lenz <lenz@cs.wisc.edu>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.6.8.1 0/2] leds: new class for led devices
Date: Fri, 3 Sep 2004 10:00:04 +0200	[thread overview]
Message-ID: <200409031000.04374.oliver@neukum.org> (raw)
In-Reply-To: <20040903133152.GH1369@pengutronix.de>

Am Freitag, 3. September 2004 15:31 schrieb Robert Schwebel:
> On Fri, Sep 03, 2004 at 03:17:15PM +0200, Robert Schwebel wrote:
> > I'll pull the gpio patch out of my working tree and post it here for
> > discussion. 
> 
> Attached. Parts of it have been taken from your LEDs patch anyway, so it
> should be not too difficult to reunify them. 
> 
> Robert
+	list_for_each_safe(lact, ltmp, &gpio_list) {
+		gpio_dev = list_entry(lact, struct gpio_device, list);
+		if (pin_nr == gpio_dev->props.pin_nr) {
+			printk(KERN_ERR "gpio pin %i is already used by %s\n",
+			       pin_nr, gpio_dev->props.owner);
+			return -EBUSY;
+		}
+	}

[..]
+	spin_lock_init(&gpio_dev->lock);
+	gpio_dev->props.pin_nr = pin_nr;

This looks like a race condition. You need to check and reserve under
a lock.

	Regards
		Oliver

  reply	other threads:[~2004-09-03  7:58 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-02 20:33 [PATCH 2.6.8.1 0/2] leds: new class for led devices John Lenz
2004-09-02 20:34 ` [PATCH 2.6.8.1 1/2] " John Lenz
2004-09-02 20:38 ` [PATCH 2.6.8.1 2/2] " John Lenz
2004-09-03  4:54 ` [PATCH 2.6.8.1 0/2] " Kalin KOZHUHAROV
2004-09-03 11:32   ` Geert Uytterhoeven
2004-09-03 12:06   ` Jan-Benedict Glaw
2004-09-03 18:47     ` John Lenz
2004-09-03 22:25       ` Russell King
2004-09-03 23:19         ` John Lenz
2004-09-04 11:12         ` Pavel Machek
2004-09-04 20:53           ` Russell King
2004-09-04 21:41             ` Pavel Machek
2004-09-06  7:36               ` John Lenz
2004-09-03 13:17 ` Robert Schwebel
2004-09-03 13:31   ` Robert Schwebel
2004-09-03  8:00     ` Oliver Neukum [this message]
2004-09-03 13:51 ` Pavel Machek
2004-09-03 18:38   ` John Lenz
2004-09-03 18:55     ` Russell King
2004-09-03 19:09       ` John Lenz
2004-09-03 19:51         ` Russell King
2004-09-03 20:35           ` John Lenz
2004-09-04 11:09     ` Pavel Machek

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=200409031000.04374.oliver@neukum.org \
    --to=oliver@neukum.org \
    --cc=lenz@cs.wisc.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robert@schwebel.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.