lkml.org 
[lkml]   [2007]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] unlock before bug returns
On Mon, 22 Oct 2007 04:58:45 +0200
Roel Kluin <12o3l@tiscali.nl> wrote:

> Roel Kluin wrote:
>
> > unlock before bug returns
>
> > if (cs >= GPMC_CS_NUM || !gpmc_cs_reserved(cs)) {
> > printk(KERN_ERR "Trying to free non-reserved GPMC
> > CS%d\n", cs);
> > - BUG();
> > spin_unlock(&gpmc_mem_lock);
> > - return;
> > + BUG();
>
>
> should we bother to unlock before panicking, or is the unlock not
> required either?

BUG() kills the current process, but not the whole system.

Unlocking the lock means that the rest of the system has somewhat
of a chance of surviving. Not unlocking means a guaranteed hang
for the rest of the system, making a BUG() no better than panic.

Please keep the unlock.

--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-10-22 06:13    [W:0.043 / U:0.448 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site