Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756228AbYKGXds (ORCPT ); Fri, 7 Nov 2008 18:33:48 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754820AbYKGX0v (ORCPT ); Fri, 7 Nov 2008 18:26:51 -0500 Received: from kroah.org ([198.145.64.141]:47559 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754097AbYKGX0u (ORCPT ); Fri, 7 Nov 2008 18:26:50 -0500 Date: Fri, 7 Nov 2008 15:26:12 -0800 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , Willy Tarreau , Rodrigo Rubira Branco , Jake Edge , Eugene Teo , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Takashi Iwai , Jaroslav Kysela , Chris Wedgwood Subject: [patch 07/16] ALSA: use correct lock in snd_ctl_dev_disconnect() Message-ID: <20081107232612.GH4282@kroah.com> References: <20081107231848.995297975@mini.kroah.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="alsa-use-correct-lock-in-snd_ctl_dev_disconnect.patch" In-Reply-To: <20081107232544.GA4282@kroah.com> User-Agent: Mutt/1.5.16 (2007-06-09) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1500 Lines: 45 2.6.25-stable review patch. If anyone has any objections, please let us know. ------------------ From: Takashi Iwai commit d8009882e9f5e1a76986c741f071edd2ad760c97 upstream The lock used in snd_ctl_dev_disconnect() should be card->ctl_files_rwlock for protection of card->ctl_files entries, instead of card->controls_rwsem. Reported-by: Vegard Nossum Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela Cc: Chris Wedgwood Signed-off-by: Greg Kroah-Hartman --- sound/core/control.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/sound/core/control.c +++ b/sound/core/control.c @@ -1426,12 +1426,12 @@ static int snd_ctl_dev_disconnect(struct 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) -- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/