On Fri, 16 Mar 2001, Junfeng Yang wrote:

> ---------------------------------------------------------
> [BUG] return with int disabled in an error path
> 
> /u2/acc/oses/linux/2.4.1/drivers/char/n_r3964.c:1036:add_msg: ERROR:INTR:990:995: 
>Interrupts inconsistent, severity `20':995
> 
> 
>       save_flags(flags);
> Start --->
>       cli();
> 
>       pMsg = kmalloc(sizeof(struct r3964_message), GFP_KERNEL);
>       TRACE_M("add_msg - kmalloc %x",(int)pMsg);
> Return without
> enabling interrupt
>       --->
>       if(pMsg==NULL)
>          return;
> 
> 
>       ... DELETED 44 lines ...
> 
>    if(pClient->sig_flags & R3964_USE_SIGIO)
>    {
>       kill_proc(pClient->pid, SIGIO, 1);
>    }
> Error --->
> }
> 
> static struct r3964_message *remove_msg(struct r3964_info *pInfo,
>                        struct r3964_client_info *pClient)
> {
> ---------------------------------------------------------


The simple 'fix' is to move the offending kmalloc() up above the cli(). 
That might actually be something else to make an automated test for - 
anything which schedules can re-enable interrupts. In general, it's bad to 
call anything which can schedule when interrupts are disabled.

But actually, the cli() is there because of the fundamentally flawed 
assumption that it provides sufficient locking. I've converted the whole 
thing to use spinlocks instead, but haven't got a test setup ATM. I'll 
poke at it more on Monday.

akpm, were you looking at this?

-- 
dwmw2



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to