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 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.

johannes

Attachment: signature.asc
Description: This is a digitally signed message part


[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