From: Jens Axboe <axboe@suse.de>
To: Oleg Drokin <green@namesys.com>
Cc: Oleg Drokin <green@linuxhacker.ru>,
alan@redhat.com, linux-kernel@vger.kernel.org, viro@math.psu.edu
Subject: Re: [2.4] init/do_mounts.c::rd_load_image() memleak
Date: Fri, 14 Mar 2003 09:09:11 +0100 [thread overview]
Message-ID: <20030314080911.GY836@suse.de> (raw)
In-Reply-To: <20030314110421.A28273@namesys.com>
On Fri, Mar 14 2003, Oleg Drokin wrote:
> Hello!
>
> On Fri, Mar 14, 2003 at 08:59:57AM +0100, Jens Axboe wrote:
>
> > > > > + if (buf)
> > > > > + kfree(buf);
> > > > kfree(NULL); is valid - you don't need this check.
> > > Almost every place I can think of does just this, so I do not see why this
> > > particular piece of code should be different.
> > Since when has that been a valid argument? :)
>
> Well, my argument is code uniformness which was always valid as long
> as it does not introduce any bugs, I think.
I agree with that.
> Do you propose somebody should go and fix all
> if ( something )
> kfree(something);
> pieces of code to read just
> kfree(something); ?
No that would just be another pointless exercise in causing more
annoyance for someone who has to look through patches finding that one
hunk that breaks stuff. The recent spelling changes come to mind.
But just because you don't seem to have seen any kfree(NULL) in the
kernel does not mean they are not there. And should a good trend not
allow to grow?
--
Jens Axboe
next prev parent reply other threads:[~2003-03-14 7:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-13 21:01 [2.4] init/do_mounts.c::rd_load_image() memleak Oleg Drokin
2003-03-13 22:03 ` Russell King
2003-03-14 7:50 ` Oleg Drokin
2003-03-14 7:59 ` Jens Axboe
2003-03-14 8:04 ` Oleg Drokin
2003-03-14 8:08 ` Zwane Mwaikambo
2003-03-14 8:09 ` Jens Axboe [this message]
2003-03-14 10:05 ` Denis Vlasenko
2003-03-14 17:40 ` John Alvord
2003-03-15 18:40 ` Horst von Brand
2003-03-15 18:36 ` Horst von Brand
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=20030314080911.GY836@suse.de \
--to=axboe@suse.de \
--cc=alan@redhat.com \
--cc=green@linuxhacker.ru \
--cc=green@namesys.com \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@math.psu.edu \
/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