Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3559789pxb; Mon, 24 Jan 2022 12:13:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJxTCxcG57aVgbala17oz/q0U2mcT8vflP9WdNUTL7wnVQXJBQCJU39eIlLV39PPruAv6I3q X-Received: by 2002:a17:902:bb87:b0:148:a2e8:2798 with SMTP id m7-20020a170902bb8700b00148a2e82798mr15102646pls.159.1643055189412; Mon, 24 Jan 2022 12:13:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643055189; cv=none; d=google.com; s=arc-20160816; b=ooSLQfFOVypEuIZySpMDGW43OFGfbMizNgAlXu+zS9DgwGvALOw40VUxkZh+1CVtvL nrm34+AoFlRIy1VCauIK5bveeo7oc3aiW2C6Sw62pixx+bZ/DxriKgDtf3ACHMPf6jv/ Ig69Fd7tXx2p/ObO7y7eT7kjvld1h3UUY74KfHvQWC079+uIpL9KSqmW7GhMfhGyfU8f e/uSxtplPxOBqli/R+3ee5AoASRAEQgL0FcW9mbGFvqnUEGu2eVOa4X21W+xMk6sYcFt 8nOZmF44UHJyazJnGghDPSIAjqgClnX2HA6haUSEf5rCuDywYAApim2snUQVP/D4qhfx Pr6A== 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=+/ye4ePx38cn9PDXXwCtNT7HeBFhOhHy4l3NAksYW30=; b=Q9ob62HttTildvL/eXnIXJ8MJ3EqtIRsE9tfKDkHQMvUg1Ka5tM029Fb8nR3eV31Bi k3Pcao6kS4UNGcmf+P/hq3T4tCmQ0LstSKNwgI1XI9o+tQTZlYGEOHiOG3QOzjKuCmHE epUdEnkrD6y9lIZg/47//Ys7InHBbKozR9WcffHg8aGUqNiZLEk6gJEUnuCoZSZSrmp6 SehR60Q8e0GaXLEZsDxYQH92MfcIi8mzoSPrrpZc5A6sghbHGVqWym0P8xmi/QTgeF8s bVlNbMd5Nl22pvoLQUGgpBzWuWtkPTzdBLhZag/AvEAHQ1QTJFZnU0LFxvvG28fQ4gSe PZ+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IGuL1nmz; 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 me3si312996pjb.16.2022.01.24.12.12.51; Mon, 24 Jan 2022 12:13:09 -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=IGuL1nmz; 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 S1343531AbiAXTP4 (ORCPT + 99 others); Mon, 24 Jan 2022 14:15:56 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:38016 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238262AbiAXTIH (ORCPT ); Mon, 24 Jan 2022 14:08:07 -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 B24C460010; Mon, 24 Jan 2022 19:08:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 969E8C340EC; Mon, 24 Jan 2022 19:08:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643051286; bh=y/E3jVcAUJEZwgN0fw5HqTsokMmFSM7zAbtJdqNaMkg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IGuL1nmzunafnCjH10YlgtVtQmUc2oRlm/x35A6kBffOvjWidUlvpztSmYduo6RzM aVJgg2wEAJqSHnJobcid4AT3g5DTqTsZbpRNfFLzEkQiAUi9V9vjE275Btv/dcPMUN 4rqV8HQZcK/aMdNb2NdjdqQ1r6fZpRxWcbTodE9s= 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 070/186] ALSA: PCM: Add missing rwsem around snd_ctl_remove() calls Date: Mon, 24 Jan 2022 19:42:25 +0100 Message-Id: <20220124183939.379094689@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 5471e9762e1af4b7df057a96bfd46cc250979b88 ] 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: a8ff48cb7083 ("ALSA: pcm: Free chmap at PCM free callback, too") Link: https://lore.kernel.org/r/20211116071314.15065-2-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/core/pcm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sound/core/pcm.c b/sound/core/pcm.c index 2b5caa8dea2e2..a228bf9331102 100644 --- a/sound/core/pcm.c +++ b/sound/core/pcm.c @@ -875,7 +875,11 @@ EXPORT_SYMBOL(snd_pcm_new_internal); static void free_chmap(struct snd_pcm_str *pstr) { if (pstr->chmap_kctl) { - snd_ctl_remove(pstr->pcm->card, pstr->chmap_kctl); + struct snd_card *card = pstr->pcm->card; + + down_write(&card->controls_rwsem); + snd_ctl_remove(card, pstr->chmap_kctl); + up_write(&card->controls_rwsem); pstr->chmap_kctl = NULL; } } -- 2.34.1