mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Bramwel Barack <bramwelbarack89@gmail.com>
Cc: jirislaby@kernel.org, linux-kernel@vger.kernel.org,
	linux-serial@vger.kernel.org
Subject: Re: [PATCH] tty: n_null: remove legacy BUG_ON() from module initialization
Date: Sun, 8 Nov 2026 08:43:54 -0500	[thread overview]
Message-ID: <2026110809-phonics-freeway-6452@gregkh> (raw)
In-Reply-To: <20261108125031.33753-1-bramwelbarack89@gmail.com>

On Sun, Nov 08, 2026 at 03:50:31PM +0300, Bramwel Barack wrote:
> The use of BUG_ON() in module initialization paths is heavily deprecated
> as it triggers a kernel panic and crashes the entire system for non-fatal
> registration failures. If tty_register_ldisc() fails (e.g., if the slot
> is already occupied), it should be handled gracefully.
> 
> Modernize the initialization path by capturing the return value of
> tty_register_ldisc(), logging a clean error message via pr_err(), and
> propagating the error code back up to the module loader.

Nice try, but no, this isn't going to work at all.  Please test this by
actually testing if this code path can ever fail.  (hint, look in the
mailing list archives...)

Why did you decide to make this change if you can't ever hit it?

thanks,


greg k-h

      reply	other threads:[~2026-11-08 13:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-08 12:50 Bramwel Barack
2026-11-08 13:43 ` Greg KH [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=2026110809-phonics-freeway-6452@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=bramwelbarack89@gmail.com \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®