Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH] ALSA: control: preserve snd_card_file_add() error code in snd_ctl_open()
@ 2026-07-07  9:09 phucduc.bui
  2026-07-07 14:43 ` Takashi Iwai
  0 siblings, 1 reply; 3+ messages in thread
From: phucduc.bui @ 2026-07-07  9:09 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai
  Cc: cassiogabrielcontato, Cezary Rojewski, Mark Brown, Kees Cook,
	linux-sound, linux-kernel, bui duc phuc

From: bui duc phuc <phucduc.bui@gmail.com>

snd_ctl_open() unconditionally overwrites the return value of
snd_card_file_add() with -ENODEV on failure, discarding the actual
error code.
This also preserves the original error code returned by
snd_card_file_add() (e.g. -ENOMEM or -ENODEV), instead of
unconditionally overwriting it with -ENODEV.
No functional change other than the returned error code in this
failure path.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
 sound/core/control.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/core/control.c b/sound/core/control.c
index 0ca9fff56e51..f64b2dec746a 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -64,7 +64,6 @@ static int snd_ctl_open(struct inode *inode, struct file *file)
 	}
 	err = snd_card_file_add(card, file);
 	if (err < 0) {
-		err = -ENODEV;
 		goto __error1;
 	}
 	if (!try_module_get(card->module)) {
-- 
2.43.0


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

end of thread, other threads:[~2026-07-08  2:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-07  9:09 [PATCH] ALSA: control: preserve snd_card_file_add() error code in snd_ctl_open() phucduc.bui
2026-07-07 14:43 ` Takashi Iwai
2026-07-08  2:17   ` Bui Duc Phuc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox