Re: [PATCH] ALSA: core: propagate actual error code from register_chrdev
From: Takashi Iwai
Date: Fri Jul 03 2026 - 07:15:13 EST
On Fri, 03 Jul 2026 12:38:40 +0200,
phucduc.bui@xxxxxxxxx wrote:
>
> From: bui duc phuc <phucduc.bui@xxxxxxxxx>
>
> The alsa_sound_init() function currently returns a hardcoded -EIO
> if register_chrdev() fails, masking specific error codes from
> __register_chrdev() such as -EINVAL, -ENOMEM, or -EBUSY.
>
> Masking these failures under a generic -EIO makes system-level
> diagnostics unnecessarily difficult. Propagating explicit error codes
> from register_chrdev() is also an established convention widely
> practiced across other subsystems.
>
> Fix this by capturing and propagating the dynamic error code from
> register_chrdev(). While at it, also assign the return value of
> snd_info_init() to the 'err' variable instead of hardcoding -ENOMEM
> to ensure consistency and future-proofing.
>
> Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
Applied to for-next branch now. Thanks.
Takashi