Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1328875pxu; Mon, 23 Nov 2020 18:45:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJwiJZ/YEDFzsil8Ut6r7ZqiI0RxqdF6inJwaNobO2qFg5K4RNyGtBSWUD4Y/Mbj+5IwDM/b X-Received: by 2002:a50:bc06:: with SMTP id j6mr2156438edh.150.1606185924905; Mon, 23 Nov 2020 18:45:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606185924; cv=none; d=google.com; s=arc-20160816; b=awNKvskuX38Ps5DEUR36d+3Sx+/ZdNny4PXmLh7McRSpuO6cw2E5lAtPbQ66paSs9G wmsPz+xvFSQFGANbp3MtSFsDVVpaIDQs9ATaxBZIlzHRwNU4DadylP2sWLb3vgPbmFvo P+jy4xdHwYR85uDXzrZxTKBXkiHLYHKc/phm9Mr6iFUdmuKcQJVKMjsRCCHyut9XPzTc pt3RmZJ9YJ9JQxzg4nEN/GlKH4puLO+A887ryr1AiB1kk9v3QyeNyXwUfcCpCUR8RRaL tncQR22joUWokJ9CaIv8fED0WuFHGiowUb8ExJo0j5D+iLsw9gF+aM7z7hsjrTpGgTAF FkJA== 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=aUXsRmQvNKoRodaHUXMVk5TmEXoxHkS9BXR1LsxmofM=; b=kXd/FOGCCUiwWVeFJVYEBfN4lGjDBS3eG56hmGAxkcgtGOxZ2/sRsQccE3J1fq4+Y9 WOVi05Y8l0yv8j9YHCbHM+bAXTol44fjN8mY6Jx6ZcKNpFcoU0nwDPyMnByV04/wO/ao LA6WtMxr9XuchC7fKHfK8lG58fDKf0EQTveLAHI7otN3oUCExNvKWzXaqY/65VUWYP9v fqeBq8FmLswwvGHKzBed9yqrqtgpR8tlEdUeiDbiXgUtqNWMQPXYlnqRH7Nt8lBaI5ni H6pr3JWp3eTsT+0QTR9F7JweVtrE7vAHmTR6OwJ59/3sm+7jieYWOiJpwYJ4sRNj5rxU NFhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BywI6hhU; 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 m26si7742948eda.594.2020.11.23.18.45.02; Mon, 23 Nov 2020 18:45:24 -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=BywI6hhU; 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 S2389273AbgKWNaX (ORCPT + 99 others); Mon, 23 Nov 2020 08:30:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:38706 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730420AbgKWM2Z (ORCPT ); Mon, 23 Nov 2020 07:28:25 -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 4C2B520728; Mon, 23 Nov 2020 12:28:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606134504; bh=L/h4vsPPUbjtzv4YMMjlE4Iof+2S9Fnn0gy83opF4fA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BywI6hhUAYhMSi74mFk1t9vw3avdxTEL/qhzmCVwAg7guOtYnTYnuO7yhBCvW/r+U B4qJmKU1q1wljUyAF1ThUujjkxPWPMSoyo2dshl0MlSx7mCzFTn5KNIbh1g5D/WQ7o Bf4QENKvb/k/kdoPk5gv4mlkQjdu28snwwvp2j3Q= 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.14 43/60] ALSA: ctl: fix error path at adding user-defined element set Date: Mon, 23 Nov 2020 13:22:25 +0100 Message-Id: <20201123121807.132747398@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121805.028396732@linuxfoundation.org> References: <20201123121805.028396732@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 @@ -1387,7 +1387,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,