mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Karsten Keil <kkeil@suse.de>
To: Arjan van de Ven <arjan@infradead.org>
Cc: Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] i4l:add some checks for valid drvid and driver pointer
Date: Thu, 29 Jun 2006 14:23:55 +0200	[thread overview]
Message-ID: <20060629122355.GA10273@pingi.kke.suse.de> (raw)
In-Reply-To: <1151580572.3122.30.camel@laptopd505.fenrus.org>

On Thu, Jun 29, 2006 at 01:29:31PM +0200, Arjan van de Ven wrote:
> 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 ;)
> 

I also was thinking about removing the printk, they are in my patch for some
time to prove (which runs for long time on my systems) that this are legal
conditions. But you are correct, now it should be removed, no need to spam
syslog.

> Also..  return is not a function, so return 1; is the preferred form,
> not return(1)..
> 

OK

(I don't know why, but for me return() looks better, but that pure
private taste)


So I will send a new patch.

-- 
Karsten Keil
SuSE Labs
ISDN development

      reply	other threads:[~2006-06-29 12:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-29 11:16 Karsten Keil
2006-06-29 11:29 ` Arjan van de Ven
2006-06-29 12:23   ` Karsten Keil [this message]

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=20060629122355.GA10273@pingi.kke.suse.de \
    --to=kkeil@suse.de \
    --cc=akpm@osdl.org \
    --cc=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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®