From: Dan Carpenter <dan.carpenter@oracle.com>
To: Quytelda Kahja <quytelda@tamalin.org>
Cc: Greg KH <gregkh@linuxfoundation.org>,
devel@driverdev.osuosl.org, christian.gromm@microchip.com,
chris@engineersdelight.de, linux-kernel@vger.kernel.org,
Michael.Fabry@microchip.com
Subject: Re: [PATCH 2/4] staging: most: Replace calls to BUG_ON() with WARN_ONCE() and return.
Date: Tue, 6 Mar 2018 12:47:28 +0300 [thread overview]
Message-ID: <20180306094728.xbhamhpwdphv6kju@mwanda> (raw)
In-Reply-To: <CAFLvi20e+D4984vypj7nVECFxh_AKVwGWTqCqfyFYJ9AV=Rvdg@mail.gmail.com>
On Tue, Mar 06, 2018 at 01:23:18AM -0800, Quytelda Kahja wrote:
> > Are you sure this will work?
> Well, my goal was just to replace the code that could crash the kernel
> and let somebody with a better understanding of this particular driver
> write the recovery code, if necessary. It seemed from context that
> the BUG_ON() calls were being used like assert() though, so I assumed
> there wasn't really much recovery to be made from that problem. If
> you feel this doesn't improve the behavior of the driver, just drop
> the patch.
>
mbo is always non-NULL just from a quick glance. I didn't look hard
enough to verify that mbo->context was OK.
It's generally best to just check the callers and delete these.
Say you have a BUG_ON() then that prevents memory corruption (not an
issue here) but it makes debugging hard. But if you just have a NULL
dereference it probably kills the driver but you get an Oops which you
can debug. So a NULL dereference is normally better than a BUG_ON().
regards,
dan carpenter
next prev parent reply other threads:[~2018-03-06 9:47 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-24 7:58 [PATCH 1/4] staging: most: Fix coding style problems Quytelda Kahja
2018-02-24 7:58 ` [PATCH 2/4] staging: most: Replace calls to BUG_ON() with WARN_ONCE() and return Quytelda Kahja
2018-03-01 16:21 ` Greg KH
2018-03-06 9:23 ` Quytelda Kahja
2018-03-06 9:47 ` Dan Carpenter [this message]
2018-03-07 1:31 ` [PATCH] staging: most: Remove unnecessary usage of BUG_ON() Quytelda Kahja
2018-03-07 8:37 ` Christian Gromm
2018-02-24 7:58 ` [PATCH 3/4] staging: most: Remove unnecessary OOM messages Quytelda Kahja
2018-02-24 7:58 ` [PATCH 4/4] staging: most: Fix missing identifier in function definition argument Quytelda Kahja
2018-03-01 16:20 ` [PATCH 1/4] staging: most: Fix coding style problems Greg KH
2018-03-02 2:11 ` [PATCH 1/2] staging: most: Fix a coding style problem Quytelda Kahja
2018-03-02 2:11 ` [PATCH 2/2] " Quytelda Kahja
2018-03-02 10:12 ` Dan Carpenter
2018-03-06 9:18 ` [PATCH v2 1/2] staging: most: Add a blank line Quytelda Kahja
2018-03-06 9:34 ` [PATCH v2 2/2] staging: most: Indent function parameter Quytelda Kahja
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=20180306094728.xbhamhpwdphv6kju@mwanda \
--to=dan.carpenter@oracle.com \
--cc=Michael.Fabry@microchip.com \
--cc=chris@engineersdelight.de \
--cc=christian.gromm@microchip.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quytelda@tamalin.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®