lkml.org 
[lkml]   [2018]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/4] staging: most: Replace calls to BUG_ON() with WARN_ONCE() and return.
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

\
 
 \ /
  Last update: 2018-03-06 10:48    [W:0.062 / U:1.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site