Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3706451pxb; Mon, 24 Jan 2022 15:56:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJzqfZCcXh8W1VdGC6qF5WRrH2E3HLlMRPWdtEdXa00bHOtaa2jc+129OGueirv7eVAUdlJB X-Received: by 2002:a05:6a00:1aca:b0:4c2:8d43:8539 with SMTP id f10-20020a056a001aca00b004c28d438539mr16278098pfv.37.1643068470731; Mon, 24 Jan 2022 15:54:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643068470; cv=none; d=google.com; s=arc-20160816; b=aLpDTt20vpblPMvzJbiA22evQn580Wv7wb//ZpkHOpYl7KAotSAzSzB3+VXB58FRas //fDD4kcC8HqnS+hKBhq+XOjhPLpVn949G3Qa6kMNyGRqxRua3yufyPgVt5q5wB3fa6k Bh3N+s5xyZbdYhkSExkA9eZw+nQAJINjgwd12PL5BEvJ9IbZfx7w9yrg2nJAEJEN1j6O 67o5OC3eboxn8CBwC7qY/WMrTeKXHQFy/E9FFSyU11+l8le6Q6KxSWRnPpbQqsEoe7D6 p4CIY2sFmJ3P0D+G3fJqiLzlIcHc+ZKGHpFoI/urHKNOP7BNTj3syYxDACVEYcqAwNZR oL3A== 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=U04E0S3aIOVCOO0akSef161KZmMTM4Cwt6/VgCheon8=; b=Zj/plDvLS9DOiqZf7Q9LAeIL65oNbgIweFAXxcF/3/hCmQOEZzSYCaeZUJ4qHOUEyJ OhL0jyHAL7on2etxudgU017sXE+nWiWjbk7kU5LHOqn0zGMMtvPrDR/oDqP9lx4TKdIo FQ09fhXyk2NqQAlVt4JaD76dSqBdqG6gRrWYU5IzgcWnZoOY2b7g4uedk30c4n3o5uqu nTeDyHeQIeiHFzXbeQzSuUUOHcjpAAJ5Pcd7wnlx5cNhJpLwRAXPA1N/N5yWTtYx41B3 rSEusNWYZyBy9XPvML0vmkYqajdSyjatPNgaduX6qMFJH2xWys+O7MqfbyvRPpoB59hD XAOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0QPQ+HQ3; 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 h12si16661943pfi.239.2022.01.24.15.54.19; Mon, 24 Jan 2022 15:54:30 -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=0QPQ+HQ3; 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 S2362819AbiAXXm6 (ORCPT + 99 others); Mon, 24 Jan 2022 18:42:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1384506AbiAXXGH (ORCPT ); Mon, 24 Jan 2022 18:06:07 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3E47C06E024; Mon, 24 Jan 2022 13:17:06 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 6D03DB8123D; Mon, 24 Jan 2022 21:17:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D179C340E4; Mon, 24 Jan 2022 21:17:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059024; bh=Md4ZH5I6rM15jQTYj4f4nWYyhIsKhAhF5qdEF3guwUA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0QPQ+HQ3bccwKNlGRUIKmtbiTD1ZE8YR46oYI23rCFheNt7LqO7F+z1dNhWvQVyCX hB33m7KOJya/s2WaTiUbWU6Y9uMkiEa/TXZEMQAQTnFhi4nVWzDgroJ2GCMWyeaTjN UqcE+3zoU6veVM4clqdt3dgHMnrT4arLioYoVSyg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai , Sasha Levin Subject: [PATCH 5.16 0447/1039] ALSA: hda: Add missing rwsem around snd_ctl_remove() calls Date: Mon, 24 Jan 2022 19:37:16 +0100 Message-Id: <20220124184140.318641098@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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 80bd64af75b4bb11c0329bc66c35da2ddfb66d88 ] 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: d13bd412dce2 ("ALSA: hda - Manage kcontrol lists") Link: https://lore.kernel.org/r/20211116071314.15065-3-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/pci/hda/hda_codec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 0c4a337c9fc0d..eda70814369bd 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -1727,8 +1727,11 @@ void snd_hda_ctls_clear(struct hda_codec *codec) { int i; struct hda_nid_item *items = codec->mixers.list; + + down_write(&codec->card->controls_rwsem); for (i = 0; i < codec->mixers.used; i++) snd_ctl_remove(codec->card, items[i].kctl); + up_write(&codec->card->controls_rwsem); snd_array_free(&codec->mixers); snd_array_free(&codec->nids); } -- 2.34.1