Received: by 2002:aa6:c429:0:b029:98:93ff:f56f with SMTP id g9csp3386289lkq; Mon, 23 Nov 2020 04:30:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJymFnzhlMysOEJsgZrTYRTA+N0EPUOyqRGRqT34mYp6jHulP3EyMnNMFEAl3nPHLaiqJajx X-Received: by 2002:a17:906:c006:: with SMTP id e6mr17831912ejz.374.1606134652567; Mon, 23 Nov 2020 04:30:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606134652; cv=none; d=google.com; s=arc-20160816; b=hHXnsN2XA9I28oj97A0Gdrykue3EbtIbdkJ1v5yzl2Dprr69jS/RebVUkGA/olyoXq UQW6QaqYlwIlgw0cp/DwaEBTLyJ9+wIjf2d4WbXUdtMTmKwtdzODbCvS8/KYyG4D0P4K CB6PKb2BWqiEIVmtNhhJTGOvMiicOtFi1ZdJTmS4avMo6FrXrV06DBlxbepO5zsU3SUa fwWrIVOUYiofF+phuyZylf3Smq91XcW6Bmk4A+m1QteewGC/eOP/PsMFdD3OotAMSP4o L9CX4iiB2AS8Lmv6xIYDfyUA3S/r1rzRYCPqkwpZwAFbEncEESHKK/s1PXLemxFUOVok zmfg== 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=EHDkL3/1CmO+6cjlLQhHIv/bYGSmdga0XljME/I8OwA=; b=j3tzFoC73sENqIYXEwExC/i/CGPR5uaHxgL+HfutlAG/fI0V2sGJNGe/9wmVfxTXHk 88ckEkKdp7FT9NrVglh4FuXvIREoXHLImTjyMwbHh7sNW0RNZ1ga+7Axl567P9T0vkQz +YMIIXdaxj4+AseF6qZhs+PhxidPYK/hNA9DBfFRMz47pziIOQI+1DX9NV5d4Q+8UkK+ UQQk3wOUoOmrFl+a4YiyJ0MfRtCCij4BnOS7uVFUvC3DkgoUOpnjgQkKSQXpEx+ZtUcA APbVPLyhP9oM1TdXUKbIRaKmhhfB23oGZYhsTbBBaufnsZY4Alz3jAfZFIyemwbzEAod zSbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UQgLUheW; 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 t12si8589910edc.181.2020.11.23.04.30.30; Mon, 23 Nov 2020 04:30:52 -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=UQgLUheW; 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 S1729446AbgKWMZw (ORCPT + 99 others); Mon, 23 Nov 2020 07:25:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:35288 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730018AbgKWMZi (ORCPT ); Mon, 23 Nov 2020 07:25:38 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0706E20888; Mon, 23 Nov 2020 12:25:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606134337; bh=g0Z9YKrnT37hyMKFikh2HEqbEut8RzhJW4ly7DsIS9E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UQgLUheWW2r+pMfYeQ3p7a7H8yj3TKVc233SzlhCsh5xE7TGhKvdLekufgkjIatfC Et7B32bFlxLsFqAKA5X60lzXxqk6r1IpVxSKpVQB4VHOqNHG2wSFlOXNu7WAnrF0d2 YblYL+5+fFdvY9yukKhX1je8P+BldNGEQtZYd+7c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Sakamoto , Takashi Iwai Subject: [PATCH 4.9 35/47] ALSA: ctl: fix error path at adding user-defined element set Date: Mon, 23 Nov 2020 13:22:21 +0100 Message-Id: <20201123121807.252955915@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121805.530891002@linuxfoundation.org> References: <20201123121805.530891002@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 Sakamoto commit 95a793c3bc75cf888e0e641d656e7d080f487d8b upstream. When processing request to add/replace user-defined element set, check of given element identifier and decision of numeric identifier is done in "__snd_ctl_add_replace()" helper function. When the result of check is wrong, the helper function returns error code. The error code shall be returned to userspace application. Current implementation includes bug to return zero to userspace application regardless of the result. This commit fixes the bug. Cc: Fixes: e1a7bfe38079 ("ALSA: control: Fix race between adding and removing a user element") Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20201113092043.16148-1-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/core/control.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/sound/core/control.c +++ b/sound/core/control.c @@ -1381,7 +1381,7 @@ static int snd_ctl_elem_add(struct snd_c unlock: up_write(&card->controls_rwsem); - return 0; + return err; } static int snd_ctl_elem_add_user(struct snd_ctl_file *file,