All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: ctl: fix error path at adding user-defined element set
@ 2020-11-13  9:20 Takashi Sakamoto
  2020-11-13 10:34   ` Takashi Iwai
  0 siblings, 1 reply; 3+ messages in thread
From: Takashi Sakamoto @ 2020-11-13  9:20 UTC (permalink / raw)
  To: tiwai, perex; +Cc: alsa-devel, stable

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: <stable@vger.kernel.org>
Fixes: e1a7bfe38079 ("ALSA: control: Fix race between adding and removing a user element")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
---
 sound/core/control.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/core/control.c b/sound/core/control.c
index 421ddc7..f341fc4 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -1539,7 +1539,7 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file,
 
  unlock:
 	up_write(&card->controls_rwsem);
-	return 0;
+	return err;
 }
 
 static int snd_ctl_elem_add_user(struct snd_ctl_file *file,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ALSA: ctl: fix error path at adding user-defined element set
  2020-11-13  9:20 [PATCH] ALSA: ctl: fix error path at adding user-defined element set Takashi Sakamoto
@ 2020-11-13 10:34   ` Takashi Iwai
  0 siblings, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2020-11-13 10:34 UTC (permalink / raw)
  To: Takashi Sakamoto; +Cc: perex, alsa-devel, stable

On Fri, 13 Nov 2020 10:20:43 +0100,
Takashi Sakamoto wrote:
> 
> 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: <stable@vger.kernel.org>
> Fixes: e1a7bfe38079 ("ALSA: control: Fix race between adding and removing a user element")
> Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>

Thanks, applied now.


Takashi

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ALSA: ctl: fix error path at adding user-defined element set
@ 2020-11-13 10:34   ` Takashi Iwai
  0 siblings, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2020-11-13 10:34 UTC (permalink / raw)
  To: Takashi Sakamoto; +Cc: alsa-devel, stable

On Fri, 13 Nov 2020 10:20:43 +0100,
Takashi Sakamoto wrote:
> 
> 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: <stable@vger.kernel.org>
> Fixes: e1a7bfe38079 ("ALSA: control: Fix race between adding and removing a user element")
> Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>

Thanks, applied now.


Takashi

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-13 10:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-13  9:20 [PATCH] ALSA: ctl: fix error path at adding user-defined element set Takashi Sakamoto
2020-11-13 10:34 ` Takashi Iwai
2020-11-13 10:34   ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.