Received: by 2002:aa6:c429:0:b029:98:93ff:f56f with SMTP id g9csp3395393lkq; Mon, 23 Nov 2020 04:44:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJza9qdQRJPw1nKc3Ri36fnRfbFbXL5ZV/8wbwy60/bQ470StT7+pJPe/+67rBrIG2aLB403 X-Received: by 2002:a17:906:b53:: with SMTP id v19mr11650692ejg.250.1606135499513; Mon, 23 Nov 2020 04:44:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606135499; cv=none; d=google.com; s=arc-20160816; b=GeXav3PshGJhxjy9IFmRV9MDaKr9l03aaE1B3i6f535J4EXUGW7++IfBlUIdZ9kyT7 8M6ybsUqttaxSb/RHJHOD7NvGVdZv1Fq494NEIDeD6cKCl8o0f4ke/0DH28G6+G0Joly hLuzcr+PUj/l6m7vJdsYyUwMjeubBJy3jdde6Ab+NzIqFd+QOeT5q8grxunzrpGNmaKz vYc7iHoirR0x7WeELUR956u8cgk79cPgvdcDfhmyFvazbVER9d3O78DeIG88aaNOKSwH rDWc6b3zTyr8wZ9HAbpb89KXtT+9b2WRH3vmKh46ByAKWZTgSpiJSw0nQ0mwY1dqroDN MeKg== 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=7313ztCvjVqaPhaY2O9HnHSc1UUBp3zxb2YNjF5FWOQ=; b=uRxaRxhW6El8SbbBWI922kZn9VvIdghyKHdZHroJSxJmZREvLu7i47QYzpP1kmhfP6 NiAZITkcI3J35cxhq0VGKoXvVTRPsblrVjcrWYvwl9alvStGN+4rWmjyBgw2ZOrmutrv yMJuAlnvE5RQKNdS9rzBnVj+7iX0rhSklNyC6cWaqKkJTUt3VGHP33PxAgmsNzAOkaL8 OZI+DO21L4iQuH50vYOg2d/U2DUKiyCGpmSfHPD6NitJMgvbx406733DqqGqO/yM0nvB Tyw+c65K2d5yDE1+cva7ZhwjwUCf27+vtksiZK5Um32sy1M19TJGkJ3/UMsdTxucbd3g /FkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=npUHZSk+; 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 s15si5643529ejb.157.2020.11.23.04.44.35; Mon, 23 Nov 2020 04:44:59 -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=npUHZSk+; 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 S1732562AbgKWMk5 (ORCPT + 99 others); Mon, 23 Nov 2020 07:40:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:53638 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732550AbgKWMkt (ORCPT ); Mon, 23 Nov 2020 07:40:49 -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 41E062065E; Mon, 23 Nov 2020 12:40:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606135249; bh=fO5bVAN3f1jN4OJmAipPGyqebLeCsbC9KfMvGfCXEZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=npUHZSk++62V4vY7QT0ZG1cuKSDw9fGz/Jeslt94n6ErQezrTn5RLq5KNS+5zGEbg U6jCr09xJHrYp6iCF2MkwbjxCFprBFSyZxuK40dMVeJA1ZJdHYYfXRC3K4KQBEcikc /ClC9Pxm3Skp7LbIY7r/ARBRMl/kyTGUaYM3ZfxM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Sakamoto , Takashi Iwai Subject: [PATCH 5.4 119/158] ALSA: ctl: fix error path at adding user-defined element set Date: Mon, 23 Nov 2020 13:22:27 +0100 Message-Id: <20201123121825.682956654@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121819.943135899@linuxfoundation.org> References: <20201123121819.943135899@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 @@ -1350,7 +1350,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,