Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3547231pxb; Mon, 24 Jan 2022 11:56:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJwoYDFXCpH4rDYC86aHDVHKtlyYZHlT59/jDt9M7dufCQaDXxLu8iRTbwDbzjdR2Cs5LOQx X-Received: by 2002:a17:90b:388c:: with SMTP id mu12mr3423013pjb.240.1643054214030; Mon, 24 Jan 2022 11:56:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643054214; cv=none; d=google.com; s=arc-20160816; b=LqCDaznljlhN2nV7ef5SQz87DKdmzBxbIyfabKHSGKDI01qVhMvQGPME4MlVhp6cdX VEgk5aAHFWlafz61VQ+UkljfdHZMDdOUm2aDhYvvI9XFRC495vQbqLf2vVGAM0eWZ1n8 V/VxRUxeH5vKMZYVeOVvwzN30C4lZEjiuRFevIBT1aFLaF2r3rorKT84CiSZcIslE7bv njNFNOX2z2FxWgD4q9yRA+rMTmKteHitFjb2U/hvS0xNuUNmUYyoEzgDakksAfxpj6BF bNsd8n5IeseWEVHslHgDoUxLnHxmXO/3tbg3AVtOzB2TTXbcpo3eM1RERSYW8wkLUs/m lByw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BYZsjNFrI/gi0NYJE6nL1En3UZVBpw3m+Wq0U/xirkw=; b=kQ5LZr7xq/5b2CPZYY3LItWP3qhqyXhL72+i8w4Ef2gBE4fINP9goHq6Uht2PRzhW6 xoDbnJ6HLklkFo76xaVPL1YJeKrN37O9CpbjcCGgsTbWIRHEQz1UzcaLOEM7AcItDagY 6hDc8g3dJqyBRe2y/sopk7r24ClDkrxC0RRks3VhCvt9dczHoZK9cIDdCzMwSkKCCBYT lIjMiEmr1kA881Xg4zetAd34q1ja3+wymJpNiwWbpW50lf0OyftiUTned2NgYYz9pTRN RfuCO4zQ2boJv0jXkPsP1YBthOcNlx/n7FoHIo+p3vlbFjIBNJPE5TL9o67pHAVYuF20 g8xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YQHHOXMV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d8si1732124pfl.206.2022.01.24.11.56.41; Mon, 24 Jan 2022 11:56:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YQHHOXMV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231865AbiAXSvO (ORCPT + 99 others); Mon, 24 Jan 2022 13:51:14 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:48834 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236766AbiAXSuJ (ORCPT ); Mon, 24 Jan 2022 13:50:09 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id ADF0A614D7; Mon, 24 Jan 2022 18:50:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8805DC340E5; Mon, 24 Jan 2022 18:50:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643050208; bh=Y6WHr/nO1RZeWIVVbbieVTNw/VGG4rsX2v4GkT3h1gw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YQHHOXMVJqU9dHSgcGeu/JfC3xTDwhUSDLEcACuw+ucoTLMs4wYURTgtZRUhixR+P mlxDNR9saJS+6HsB22PUXrtM+gYg1V0NWQt/BlD9tZ5zyeSqrpooKEY3xM0y7MjZpY u6QD+o0bdEQrX90bNBeHn1LukJg2RJaZmxp/g8sc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai , Sasha Levin Subject: [PATCH 4.4 043/114] ALSA: jack: Add missing rwsem around snd_ctl_remove() calls Date: Mon, 24 Jan 2022 19:42:18 +0100 Message-Id: <20220124183928.438211582@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183927.095545464@linuxfoundation.org> References: <20220124183927.095545464@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Takashi Iwai [ Upstream commit 06764dc931848c3a9bc01a63bbf76a605408bb54 ] snd_ctl_remove() has to be called with card->controls_rwsem held (when called after the card instantiation). This patch add the missing rwsem calls around it. Fixes: 9058cbe1eed2 ("ALSA: jack: implement kctl creating for jack devices") Link: https://lore.kernel.org/r/20211116071314.15065-1-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/core/jack.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/core/jack.c b/sound/core/jack.c index fcc972fbe8ffd..ecbdac88f95ad 100644 --- a/sound/core/jack.c +++ b/sound/core/jack.c @@ -64,10 +64,13 @@ static int snd_jack_dev_free(struct snd_device *device) struct snd_card *card = device->card; struct snd_jack_kctl *jack_kctl, *tmp_jack_kctl; + down_write(&card->controls_rwsem); list_for_each_entry_safe(jack_kctl, tmp_jack_kctl, &jack->kctl_list, list) { list_del_init(&jack_kctl->list); snd_ctl_remove(card, jack_kctl->kctl); } + up_write(&card->controls_rwsem); + if (jack->private_free) jack->private_free(jack); -- 2.34.1