Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3559755pxb; Mon, 24 Jan 2022 12:13:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJxhje/sGSxfu0IG0i+oR5scXw0T8UF02Y6ScSbalGPY6dYo75ZcgSriKUYrFZ8svQ1DIsPw X-Received: by 2002:a17:903:234c:b0:14b:1632:9267 with SMTP id c12-20020a170903234c00b0014b16329267mr16321241plh.45.1643055186858; Mon, 24 Jan 2022 12:13:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643055186; cv=none; d=google.com; s=arc-20160816; b=p6bF07vJ+4LYJEQfnrHXf9ehLTlLVuLq4hDMo/hx85k9YMlmqVM5HCSN/mZNNRToBo oZCcytW9YUe7k74V1PZtOPOrsv2auGgQyf7mivWuHD+CoMkMTJhpafundpsMv1hBlpQ4 mig7mpcjNJiRXUlThfGav3CSgwyJ17mE+06bPVZtkw2fGsq/bYFIzw3JM4BLZ3AhHoKs h9Yqhzjg/l0oNIIRwjUDJT7rt8blQ7j4NLUFTGOxRiDQnAnWadbHcQXkleAq9DhPPjhb b1SjRWS+2ocGRjm67rFZgfYyr8S95yq767A2ELx2syU85wNyJQXeWhetiPPLXUmwlyrV IZEA== 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=Jhe0SsMmuokLUoIpx1y3XXIYncv/KoPDY0Gzf4yXVec=; b=EyrD6oc2OiF91CLzNZgDYPAD1Jt3wrOIwAJVseMd3qScdiZV3q27FWL4hrHYBHn6+Q dzZo4tjuR8/G1FMCKeuI4TqCh1jElVc2JsoNfOGaSLWY4A9PPg9iOGXV8kGLbFBFby9z U5TdcaO6w/H4Yd0FJMLdXf06l/h0vFhVFjv11mFXNUncdHZUq0pPJHV2lF38SwEXpPRd DBny0XFLCArP7zAWMqqJrP0wKKUM02GKvyu3lW9B3clIrhb7ZH3g09ZLXGOLL34G6aOt PHxbSr32ptbPgMkFV1H9pVr1471mpf38bcQhZTXbKhD8UV/08r4jLJWin00rohzxc4je T60Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BVCbacqu; 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 r19si1468521plr.611.2022.01.24.12.12.48; Mon, 24 Jan 2022 12:13:06 -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=BVCbacqu; 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 S1345055AbiAXTPw (ORCPT + 99 others); Mon, 24 Jan 2022 14:15:52 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:36230 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345297AbiAXTGR (ORCPT ); Mon, 24 Jan 2022 14:06:17 -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 0FF766121F; Mon, 24 Jan 2022 19:06:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8A74C340E5; Mon, 24 Jan 2022 19:06:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643051175; bh=6YLW78DEnS5dNSAdV+HGmI0LffLmBTnA0Y1T2eBhgkI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BVCbacquuWrw6T7+hOi9v3TBm2mAYmRmSkBnGk+FYncj02+R6/eLbdHqGinZp8vk1 Af+c4g/uuCbcPQaM/1zE+z0RTa1svKe3i7P3tBY+Y0f3gXa5h22wRIOZNLDDAAZGr8 OfnnGJOhlWBjw+zT7HUPv/WcUbTBQbPArwcIzF2Y= 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.14 071/186] ALSA: hda: Add missing rwsem around snd_ctl_remove() calls Date: Mon, 24 Jan 2022 19:42:26 +0100 Message-Id: <20220124183939.410438986@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183937.101330125@linuxfoundation.org> References: <20220124183937.101330125@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 a56f018d586f5..8ec73955170b4 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -1680,8 +1680,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