Messages in this thread | | | Subject | Re: [PATCH] i4l:add some checks for valid drvid and driver pointer | From | Arjan van de Ven <> | Date | Thu, 29 Jun 2006 13:29:31 +0200 |
| |
On Thu, 2006-06-29 at 13:16 +0200, Karsten Keil wrote: > If all drivers go away before all ISDN network interfaces are closed we got > a OOps on removing interfaces, this patch avoid it. > > Signed-off-by: Karsten Keil <kkeil@suse.de> > > diff -ur linux-2.6.4.org/drivers/isdn/i4l/isdn_common.c linux-2.6.4/drivers/isdn/i4l/isdn_common.c > --- linux-2.6.4.org/drivers/isdn/i4l/isdn_common.c 2004-03-11 03:55:25.000000000 +0100 > +++ linux-2.6.4/drivers/isdn/i4l/isdn_common.c 2004-03-30 18:35:38.000000000 +0200 > @@ -341,6 +341,16 @@ > printk(KERN_WARNING "isdn_command command(%x) driver -1\n", cmd->command); > return(1); > } > + if (!dev->drv[cmd->driver]) { > + printk(KERN_WARNING "isdn_command command(%x) dev->drv[%d] NULL\n", > + cmd->command, cmd->driver); > + return(1); > + }
Hi,
if this is a "legal" condition, you really shouldn't printk about it. If it's not a normal legal condition, this isn't a fix but a hacky workaround ;)
Also.. return is not a function, so return 1; is the preferred form, not return(1)..
Greetings, Arjan van de Ven
- 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/
| |