From: Vegard Nossum <vegard.nossum@gmail.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Edgar Kalkowski <eMail@edgar-kalkowski.de>,
linux-kernel@vger.kernel.org
Subject: [PATCH] sound: use the right lock in snd_ctl_dev_disconnect
Date: Tue, 23 Sep 2008 20:00:08 +0200 [thread overview]
Message-ID: <20080923180008.GA11701@localhost.localdomain> (raw)
Hi,
I never saw any follow-up on this, so here's the patch (in case it was
simply forgotten). Please ignore if it has already been applied to some
development tree. Compile-tested only.
Vegard
>From 14865508117c3727d2c11569201bef6fbcaeb434 Mon Sep 17 00:00:00 2001
From: Vegard Nossum <vegard.nossum@gmail.com>
Date: Tue, 23 Sep 2008 19:50:48 +0200
Subject: [PATCH] sound: use the right lock in snd_ctl_dev_disconnect
&card->ctl_files is protected by &card->ctl_files_rwlock, not
&card->controls_rwsem. Fix it.
Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
---
sound/core/control.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/core/control.c b/sound/core/control.c
index 281b2e2..236bbb1 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -1427,12 +1427,12 @@ static int snd_ctl_dev_disconnect(struct snd_device *device)
cardnum = card->number;
snd_assert(cardnum >= 0 && cardnum < SNDRV_CARDS, return -ENXIO);
- down_read(&card->controls_rwsem);
+ read_lock(&card->ctl_files_rwlock);
list_for_each_entry(ctl, &card->ctl_files, list) {
wake_up(&ctl->change_sleep);
kill_fasync(&ctl->fasync, SIGIO, POLL_ERR);
}
- up_read(&card->controls_rwsem);
+ read_unlock(&card->ctl_files_rwlock);
if ((err = snd_unregister_device(SNDRV_DEVICE_TYPE_CONTROL,
card, -1)) < 0)
--
1.5.5.1
next reply other threads:[~2008-09-23 18:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-23 18:00 Vegard Nossum [this message]
2008-09-24 7:27 ` Takashi Iwai
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=20080923180008.GA11701@localhost.localdomain \
--to=vegard.nossum@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=eMail@edgar-kalkowski.de \
--cc=linux-kernel@vger.kernel.org \
--cc=tiwai@suse.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 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®