From fb0fb4b94362a89da605058269bceb481a5e60b6 Mon Sep 17 00:00:00 2001 From: bui duc phuc Date: Tue, 7 Jul 2026 15:45:04 +0700 Subject: [PATCH] ALSA: mixer: oss: Return -ENODEV instead of -EFAULT in snd_mixer_oss_open() When try_module_get() fails in snd_mixer_oss_open(), the owning module is going away and the device is no longer usable, so -EFAULT ("bad address") is the wrong error. Return -ENODEV, matching the other unavailable-device paths in this function(the NULL card check and the NULL mixer_oss check). This changes the errno reported to userspace on this rare race. No other behaviour changes. Signed-off-by: bui duc phuc Reviewed-by: Cezary Rojewski Signed-off-by: Takashi Iwai Link: https://patch.msgid.link/20260707084506.718583-5-phucduc.bui@gmail.com --- sound/core/oss/mixer_oss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c index f5bcc7896542..3a1dd1edd26d 100644 --- a/sound/core/oss/mixer_oss.c +++ b/sound/core/oss/mixer_oss.c @@ -58,7 +58,7 @@ static int snd_mixer_oss_open(struct inode *inode, struct file *file) kfree(fmixer); snd_card_file_remove(card, file); snd_card_unref(card); - return -EFAULT; + return -ENODEV; } snd_card_unref(card); return 0;