mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
ALSA: info: Return -ENODEV instead of -EFAULT in alloc_info_private()
When try_module_get() fails in alloc_info_private(), 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 -ENODEV path in the
same function.
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-4-phucduc.bui@gmail.com
This commit is contained in:
parent
c49e88ea6c
commit
52f15bf51b
|
|
@ -78,7 +78,7 @@ static int alloc_info_private(struct snd_info_entry *entry,
|
|||
if (!entry || !entry->p)
|
||||
return -ENODEV;
|
||||
if (!try_module_get(entry->module))
|
||||
return -EFAULT;
|
||||
return -ENODEV;
|
||||
data = kzalloc_obj(*data);
|
||||
if (!data) {
|
||||
module_put(entry->module);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user