Search Linux Wireless

Re: [PATCH 5/8] rfkill: add WARN_ON and BUG_ON paranoia

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sunday 03 August 2008, Johannes Berg wrote:
> On Sun, 2008-08-03 at 10:07 +0200, Ivo van Doorn wrote:
> 
> > > diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c
> > > index ea872e5..d5f95cb 100644
> > > --- a/net/rfkill/rfkill.c
> > > +++ b/net/rfkill/rfkill.c
> > > @@ -76,6 +76,7 @@ static BLOCKING_NOTIFIER_HEAD(rfkill_notifier_list);
> > >   */
> > >  int register_rfkill_notifier(struct notifier_block *nb)
> > >  {
> > > +	BUG_ON(!nb);
> > 
> > Probably better:
> > 
> > 	if (unlikely(!nb) {
> > 		BUG()
> > 		return -EINVAL;
> > 	}
> 
> Heh, not really, in fact, it will most likely not even compile to any
> different code. Did you mean
> 
> if (WARN_ON(!nb))
> 	return -EINVAL;
> 
> maybe?
> 
> BUG() never returns. Same for all the other places you pointed out.

Ah right, that doesn't sound too good. I don't think rfkill should
become a blocker like that. WARN_ON should be sufficient. :)

Ivo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux