mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Julia Lawall <julia@diku.dk>
To: Olaf Weber <olaf@sgi.com>
Cc: felixb@sgi.com, xfs-masters@oss.sgi.com, xfs@oss.sgi.com,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 1/2] fs/xfs: Drop unnecessary NULL test
Date: Tue, 14 Jul 2009 14:15:42 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0907141412550.456@ask.diku.dk> (raw)
In-Reply-To: <bzy7hybzh6k.fsf@fransum.emea.sgi.com>

On Tue, 14 Jul 2009, Olaf Weber wrote:

> Julia Lawall writes:
> 
> > From: Julia Lawall <julia@diku.dk>
> > The result of container_of should not be NULL.  In particular, in this case
> > the argument to the enclosing function has passed though INIT_DELAYED_WORK,
> > which dereferences it, implying that its container cannot be NULL.
> 
> Given the defn of container_of() it seems clear that neither its input
> pointer nor its result should ever be NULL.

container_of just does pointer arithmetic.  The result of that arithmetic 
can be NULL, ie if the argument was obtained from an expression of the 
form &x->f where x was NULL.  But in principle, values should be checked 
for NULL beforehand.

julia

      reply	other threads:[~2009-07-14 12:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-13 10:10 Julia Lawall
2009-07-14 10:34 ` Olaf Weber
2009-07-14 12:15   ` Julia Lawall [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=Pine.LNX.4.64.0907141412550.456@ask.diku.dk \
    --to=julia@diku.dk \
    --cc=felixb@sgi.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olaf@sgi.com \
    --cc=xfs-masters@oss.sgi.com \
    --cc=xfs@oss.sgi.com \
    /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®