Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3547296pxb; Mon, 24 Jan 2022 11:57:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJzTCh1Nw8zcgmyGhnjOGVoF+DXcZAju98wfWkvsja4GQKsqG4wJck3YCh8HrCuBDCf3GlIw X-Received: by 2002:a17:902:8bc5:b0:149:88fc:5560 with SMTP id r5-20020a1709028bc500b0014988fc5560mr16120858plo.144.1643054220235; Mon, 24 Jan 2022 11:57:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643054220; cv=none; d=google.com; s=arc-20160816; b=GwAGZUDduE9TWV/z4MqYf0yaUfuILq5LI2D7kh+7j3ZSVl/IOfn7SaMq7+t+rmz2++ uWEnj5GuHG9zf4l9S2LnuueOtlJSPMHrMjUDnrUbis9vv7/dUItfCuP51ajDTRe0WFyz sBCYA8M//syqsLZiUO4sCcpOnTcq5Y5FZCGr+8jAu5j8/1GC6SYrOOE6J9EpXMndeWfJ GuipfuK4n/H+wRcA4GjcGXuFUCYHzVnOCYmId6EMWlfNnRerOBFumImt+fQOxnBjckjr H6bZkOk91eWpncur1jby2VXI79s6XJ4oUmA4JeDUHFrpMK5JWOK5l3jLoJ8U2Wf7vqpQ t0OA== 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=Uwi2dvKYcBzCzBQ5b+crH8XPuhBCEOJQW6ruehFOom8=; b=rTI/PeFrSQHCPwTkFHn44Gd2v3qpCUFHvNfKBhvBY6WeK9zO+f+83l2246NKG66u5E OhiEOLOByKEDOGEiTpzORjNqDpGmalNFTeXLGArpem69vwy6DQzUbQEkf/A3D28vPvMA SsLU1cqu3hSAOqThBcxKIye260n4wbdc3IuRYju+SCJq2aTgo+W0IvDtQRYz9jeOMDX0 U3ireTrvHtFZrAceafEkaiG3YrzOTDiGlKJpfxcoLdfrR/hAUSsntVMUnP0JGYeS0HDp BvI3L+dy0cfjCGQZoHyf6ICy1d1fzyDUbl+f1u/+cUYWgXi5vaM0UCtHCmB3erVyAJyl F2zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eloj5W58; 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 h5si2538464pgc.690.2022.01.24.11.56.47; Mon, 24 Jan 2022 11:57:00 -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=eloj5W58; 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 S245645AbiAXSvY (ORCPT + 99 others); Mon, 24 Jan 2022 13:51:24 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:48972 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242005AbiAXSuP (ORCPT ); Mon, 24 Jan 2022 13:50:15 -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 258E0614EE; Mon, 24 Jan 2022 18:50:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01E44C340EC; Mon, 24 Jan 2022 18:50:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643050214; bh=u4rdTNfjLYwAFzUQETfWg9clXMBotXlWIY1suq3Pf0k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eloj5W58uMgn3cktv3oEmNS/OY5acNiWJLdwLyimvooXnK+vyYdpUIqH4ue1Tx+Zv yZPiYcaGJ9BRQzbEEE7Rup5fjkCooJJXFnbG9sFXe9tU2EhC3m5x1oSX6oDhKVcP7/ /aU1Pme6qn54UP/Qx0kqKz/JuQXvr50tc0Ke0h4U= 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 045/114] ALSA: hda: Add missing rwsem around snd_ctl_remove() calls Date: Mon, 24 Jan 2022 19:42:20 +0100 Message-Id: <20220124183928.497524144@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 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 4962a9d8a572b..7533f8860c57e 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -1608,8 +1608,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