public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Yuvraj Singh Chauhan <ysinghcin@gmail.com>
Cc: parthiban.veerasooran@microchip.com,
	christian.gromm@microchip.com, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: most: dim2: replace BUG_ON with WARN_ON_ONCE and error handling
Date: Mon, 9 Feb 2026 11:33:48 +0100	[thread overview]
Message-ID: <2026020918-cognition-lemon-b050@gregkh> (raw)
In-Reply-To: <20260209101829.2121131-1-ysinghcin@gmail.com>

On Mon, Feb 09, 2026 at 03:48:29PM +0530, Yuvraj Singh Chauhan wrote:
> Replace BUG_ON() with WARN_ON_ONCE() and proper error handling in the
> DIM2 driver. BUG_ON() crashes the entire kernel, which is excessive for
> conditions that can be handled by returning error codes or exiting the
> function early.

WARN_ON() also crashes the kernel if you have panic-on-warn enabled,
which a few billion Linux systems in the world currently have.

So this isn't a valid change at all, sorry.  If these things can happen,
properly handle the error and recover.  If no recovery is possible, and
by hitting these cases the system is so broken that total loss of all
data and memory is the only valid solution, then BUG_ON() should remain.

hope this helps,

greg k-h

      reply	other threads:[~2026-02-09 10:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-09 10:18 [PATCH] staging: most: dim2: replace BUG_ON with WARN_ON_ONCE and error handling Yuvraj Singh Chauhan
2026-02-09 10:33 ` 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=2026020918-cognition-lemon-b050@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=christian.gromm@microchip.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=parthiban.veerasooran@microchip.com \
    --cc=ysinghcin@gmail.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