public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sesterhenn / Snakebyte <snakebyte@gmx.de>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Linas Vepstas <linas@austin.ibm.com>, Greg KH <greg@kroah.com>,
	linux-pci@atrey.karlin.mff.cuni.cz,
	Eric Sesterhenn <snakebyte@gmx.de>,
	Greg Kroah-Hartman <gregkh@suse.de>,
	linux-kernel@vger.kernel.org
Subject: Re: Fault tolerance/bad patch, [was Re: [PATCH 29/30] [PATCH] PCI Hotplug: fake NULL pointer dereferences in IBM Hot Plug Controller Driver]
Date: Fri, 23 Jun 2006 17:52:22 +0200	[thread overview]
Message-ID: <20060623155222.GA1461@whiterabbit> (raw)
In-Reply-To: <1151076504.4549.51.camel@localhost.localdomain>

* Alan Cox (alan@lxorguk.ukuu.org.uk) wrote:
> Ar Gwe, 2006-06-23 am 10:04 -0500, ysgrifennodd Linas Vepstas:
> > If someone in the future changes the hotplug core so that it 
> > sometimes returns a null value, this code will potentially crash
> > and/or do other bad things (corrupt, invalid state, etc.)
> > This means that this routine will no longer be "robust" in the face of
> > changes in other parts of the kernel. 
> 
> "Potentially".
> 
> But if you replaced it with
> 
> BUG_ON(value == NULL);
> 
> you'd both clean up the if and improve the reliability even more
> 
> > I can hear the objections:
> > -- Performance. B.S. This routine is not performance critical, it will
> >    get called once a week, once a month or less often; a few extra
> >    cycles are utterly irrelevant.
> 
> (and half the time gcc eliminates the test itself)
> 

I guess the BUG_ON makes more sense than keeping the
check, the reason coverity stumbled across this,
is the debug("get_attention_status - Exit rc[%d] value[%x]\n", rc,
*value); call some lines later, which uses the pointer.
If we just keep the check, we should also put one
around the debug statement

Greetings, Eric

  reply	other threads:[~2006-06-23 15:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1150753481625-git-send-email-greg@kroah.com>
     [not found] ` <115075348565-git-send-email-greg@kroah.com>
     [not found]   ` <11507534883521-git-send-email-greg@kroah.com>
     [not found]     ` <11507534914002-git-send-email-greg@kroah.com>
     [not found]       ` <11507534953044-git-send-email-greg@kroah.com>
     [not found]         ` <11507534983982-git-send-email-greg@kroah.com>
     [not found]           ` <11507535021937-git-send-email-greg@kroah.com>
     [not found]             ` <11507535054091-git-send-email-greg@kroah.com>
     [not found]               ` <11507535082418-git-send-email-greg@kroah.com>
     [not found]                 ` <11507535123764-git-send-email-greg@kroah.com>
2006-06-23 15:04                   ` Fault tolerance/bad patch, [was Re: [PATCH 29/30] [PATCH] PCI Hotplug: fake NULL pointer dereferences in IBM Hot Plug Controller Driver] Linas Vepstas
2006-06-23 15:28                     ` Alan Cox
2006-06-23 15:52                       ` Eric Sesterhenn / Snakebyte [this message]
2006-06-23 18:33                     ` Greg KH

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=20060623155222.GA1461@whiterabbit \
    --to=snakebyte@gmx.de \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=greg@kroah.com \
    --cc=gregkh@suse.de \
    --cc=linas@austin.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@atrey.karlin.mff.cuni.cz \
    /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