Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1238016pxu; Mon, 23 Nov 2020 15:36:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJwN9heiK26Z7Ewey0FX3KlTYj4sXkCqyTMnlQ8kiJaIG7Ud8Z+d4aKBdE/n5wiViO2lpqTW X-Received: by 2002:aa7:c049:: with SMTP id k9mr1478332edo.49.1606174563427; Mon, 23 Nov 2020 15:36:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606174563; cv=none; d=google.com; s=arc-20160816; b=yjbFTotz+TM82OydKn9k5eJuvnE5ThG9lH0HQZ3EQizmihM8eTVE/8WUv0o+91nw76 ejNe4XuUAyLtnMYnds/m2u623jLS0NkhEeIyP7awe+ZDYlwm2bksU0Nmd4KKiHwGVpnV L6tOYXkfPHgWYf0dTgM5HA2s4QZlUZaydYudMpU2JdhhWqE4NDQrkAqbYJi5TMpO6g/8 VVzGk7qPTS53haVAme7NQifTC8fW4OLmBwNQApWlNfT+6ZpVvoxXIIdM0eBzB3N27CSp MgYSSS2W2VtQJOGfFlxsb/NH4F2p6fFdEXbNJf6a0Yed8Mec0+8ttiAHtxDJMeXPsMtl XhFA== 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=PMKgGW7Pymo0eUlKtHgd4R3w2i0ccajH4QyXWcVbLSU=; b=X9Y7PGu1CyFXspyyBdQ9NSuRYZPs/xAviCqjml8+lnvd6hXi9RvXUo7OiI+775EGtx j5AIPiQcWAHr1iQDChE50qqKX2nyycG4101tLP4cy7o/iYjvLku3f2NoOUrTTxw/4SEd bvwdtg+67JWTffaS88c20Sq4O7xp8bYAXwKFy4gtOkEDgWtAFsEalOb5hu61bgRjAwDi N+6jl0MDg/7gjbBiHEgcP/+dvrBWP5wGJbcIUJD5pobAeICNJHCdrRUZuERSKAqCo7Ro te2VtKokUk4YDO/h39dWoaG2ubWdSpkvbAfFk892qlkijoMKMkRrQVYAzGjBRYmG4cjk qoOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BO5nX+vp; 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 a23si7360969ejy.682.2020.11.23.15.35.41; Mon, 23 Nov 2020 15:36:03 -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=BO5nX+vp; 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 S1730010AbgKWMdc (ORCPT + 99 others); Mon, 23 Nov 2020 07:33:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:44798 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731196AbgKWMdV (ORCPT ); Mon, 23 Nov 2020 07:33:21 -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 E9B4A2076E; Mon, 23 Nov 2020 12:33:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606134799; bh=tJK7RPtLN2AbqbZxXMT2lFh24EFVd86xLU77Ym4rreo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BO5nX+vpEBP5wmB1qTXukMPFpndr8CRXYfdfFlZ1E5Gi6VJQTdj2ZQ2DWq86JH6oD h/LwR3y9ejAvFiCziph+y4fDivOvcU8MIXJHeFlC9FdoKOJRPi0B+Plhm6RJoP5y/u eCB2eH1nsNo4N6pjT+8z/q/kdfZ4vZxXGJjLGq14= 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.19 69/91] ALSA: ctl: fix error path at adding user-defined element set Date: Mon, 23 Nov 2020 13:22:29 +0100 Message-Id: <20201123121812.678479184@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121809.285416732@linuxfoundation.org> References: <20201123121809.285416732@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 @@ -1388,7 +1388,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,