mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
ALSA: control: Return -ENODEV instead of -EFAULT in snd_ctl_open()
When try_module_get() fails in snd_ctl_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 snd_card_file_add() failure).
This changes the errno reported to userspace on this rare race.
No other behaviour changes.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260707084506.718583-2-phucduc.bui@gmail.com
This commit is contained in:
parent
bf08a5f698
commit
b45f4e8d78
|
|
@ -68,7 +68,7 @@ static int snd_ctl_open(struct inode *inode, struct file *file)
|
|||
goto __error1;
|
||||
}
|
||||
if (!try_module_get(card->module)) {
|
||||
err = -EFAULT;
|
||||
err = -ENODEV;
|
||||
goto __error2;
|
||||
}
|
||||
ctl = kzalloc(sizeof(*ctl), GFP_KERNEL);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user