The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: phucduc.bui@gmail.com
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	cassiogabrielcontato@gmail.com, Kees Cook <kees@kernel.org>,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ALSA: core: propagate actual error code from register_chrdev
Date: Fri, 03 Jul 2026 13:07:40 +0200	[thread overview]
Message-ID: <87tsqg72mb.wl-tiwai@suse.de> (raw)
In-Reply-To: <20260703103840.253527-1-phucduc.bui@gmail.com>

On Fri, 03 Jul 2026 12:38:40 +0200,
phucduc.bui@gmail.com wrote:
> 
> From: bui duc phuc <phucduc.bui@gmail.com>
> 
> 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@gmail.com>

Applied to for-next branch now.  Thanks.


Takashi

      reply	other threads:[~2026-07-03 11:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-03 10:38 [PATCH] ALSA: core: propagate actual error code from register_chrdev phucduc.bui
2026-07-03 11:07 ` Takashi Iwai [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tsqg72mb.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=cassiogabrielcontato@gmail.com \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=phucduc.bui@gmail.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox