From: Dan Carpenter <dan.carpenter@oracle.com>
To: walter harms <wharms@bfs.de>
Cc: Julia Lawall <julia.lawall@lip6.fr>,
Theodore Ts'o <tytso@mit.edu>,
Michael Halcrow <mhalcrow@google.com>,
Andreas Dilger <adilger.kernel@dilger.ca>,
linux-ext4@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] ext4 crypto: testing the wrong variable
Date: Wed, 08 Apr 2015 12:22:51 +0000 [thread overview]
Message-ID: <20150408122251.GJ10964@mwanda> (raw)
In-Reply-To: <5525162C.3020808@bfs.de>
On Wed, Apr 08, 2015 at 01:51:08PM +0200, walter harms wrote:
>
>
> Am 08.04.2015 11:51, schrieb Julia Lawall:
> >> void ext4_fname_crypto_free_buffer(void **buf)
> >> {
> >> - if (*buf = NULL || IS_ERR(buf))
> >> + if (*buf = NULL || IS_ERR(*buf))
> >
> > Why not use IS_ERR_OR_NULL?
> >
> > julia
>
>
> why test *buf = NULL ? xfree() can handle this.
>
> the question is do programm depend on *buf=NULL.
> In case of IS_ERR(*buf) *buf will be left unchanged
> and later prgramms may things there is a buffer
> available ?
Good point. That IS_ERR() check is going to cause all kinds of future
bugs.
regards,
dan carpenter
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: walter harms <wharms@bfs.de>
Cc: Julia Lawall <julia.lawall@lip6.fr>,
"Theodore Ts'o" <tytso@mit.edu>,
Michael Halcrow <mhalcrow@google.com>,
Andreas Dilger <adilger.kernel@dilger.ca>,
linux-ext4@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] ext4 crypto: testing the wrong variable
Date: Wed, 8 Apr 2015 15:22:51 +0300 [thread overview]
Message-ID: <20150408122251.GJ10964@mwanda> (raw)
In-Reply-To: <5525162C.3020808@bfs.de>
On Wed, Apr 08, 2015 at 01:51:08PM +0200, walter harms wrote:
>
>
> Am 08.04.2015 11:51, schrieb Julia Lawall:
> >> void ext4_fname_crypto_free_buffer(void **buf)
> >> {
> >> - if (*buf == NULL || IS_ERR(buf))
> >> + if (*buf == NULL || IS_ERR(*buf))
> >
> > Why not use IS_ERR_OR_NULL?
> >
> > julia
>
>
> why test *buf == NULL ? xfree() can handle this.
>
> the question is do programm depend on *buf=NULL.
> In case of IS_ERR(*buf) *buf will be left unchanged
> and later prgramms may things there is a buffer
> available ?
Good point. That IS_ERR() check is going to cause all kinds of future
bugs.
regards,
dan carpenter
next prev parent reply other threads:[~2015-04-08 12:22 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-08 8:53 [patch] ext4 crypto: testing the wrong variable Dan Carpenter
2015-04-08 8:53 ` Dan Carpenter
2015-04-08 9:51 ` Julia Lawall
2015-04-08 9:51 ` Julia Lawall
2015-04-08 11:51 ` walter harms
2015-04-08 11:51 ` walter harms
2015-04-08 12:22 ` Dan Carpenter [this message]
2015-04-08 12:22 ` Dan Carpenter
2015-04-11 13:48 ` Theodore Ts'o
2015-04-11 13:48 ` Theodore Ts'o
2015-04-15 9:26 ` Dan Carpenter
2015-04-15 9:26 ` Dan Carpenter
2015-04-08 18:15 ` Andreas Dilger
2015-04-08 18:15 ` Andreas Dilger
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=20150408122251.GJ10964@mwanda \
--to=dan.carpenter@oracle.com \
--cc=adilger.kernel@dilger.ca \
--cc=julia.lawall@lip6.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=mhalcrow@google.com \
--cc=tytso@mit.edu \
--cc=wharms@bfs.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.