Re: [PATCH v2] ALSA: control: preserve snd_card_file_add() error code in snd_ctl_open()

From: Takashi Iwai

Date: Wed Jul 08 2026 - 07:03:44 EST


On Wed, 08 Jul 2026 04:35:40 +0200,
phucduc.bui@xxxxxxxxx wrote:
>
> From: bui duc phuc <phucduc.bui@xxxxxxxxx>
>
> snd_ctl_open() unconditionally overwrites the return value of
> snd_card_file_add() with -ENODEV on failure, discarding the actual
> error code.
>
> Fix this by directly returning the original error code returned by
> snd_card_file_add() (e.g. -ENOMEM or -ENODEV). This behavior is
> consistent with the error handling used in other functions such as
> snd_mixer_oss_open(), snd_hwdep_open(), snd_pcm_oss_open(), and others.
>
> There is no functional change other than the returned error code in this
> failure path.
>
> Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>

Applied now to for-next branch. Thanks.


Takashi