All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: "\"Cédric Augonnet\"" <cedric.augonnet@gmail.com>
Cc: cmm@us.ibm.com, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org
Subject: Re: [EXT4 set 6][PATCH 1/1]Export jbd stats through procfs
Date: Tue, 10 Jul 2007 21:42:21 -0700	[thread overview]
Message-ID: <20070710214221.26539eb6.akpm@linux-foundation.org> (raw)
In-Reply-To: <f56c1ba00707102021k13a758cbx66cbb6ec8bffac49@mail.gmail.com>

On Tue, 10 Jul 2007 23:21:49 -0400 "Cédric Augonnet" <cedric.augonnet@gmail.com> wrote:

> 2007/7/10, Andrew Morton <akpm@linux-foundation.org>:
> 
> Hi all,
> 
> > > +     size = sizeof(struct transaction_stats_s);
> > > +     s->stats = kmalloc(size, GFP_KERNEL);
> > > +     if (s == NULL) {
> > > +             kfree(s);
> > > +             return -EIO;
> >
> > ENOMEM
> 
> I'm sorry if i missed some point, but i just don't see the use of such
> a kfree here, not sure Andrew meant you should only return ENOMEM
> instead, but why issuing those kfree(NULL), instead of just a if (!s)
> return ENOMEM ?
> 

You found a bug.  It was meant to be

	if (s->stats == NULL)


-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: "\"Cédric Augonnet\"" <cedric.augonnet@gmail.com>
Cc: cmm@us.ibm.com, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org
Subject: Re: [EXT4 set 6][PATCH 1/1]Export jbd stats through procfs
Date: Tue, 10 Jul 2007 21:42:21 -0700	[thread overview]
Message-ID: <20070710214221.26539eb6.akpm@linux-foundation.org> (raw)
In-Reply-To: <f56c1ba00707102021k13a758cbx66cbb6ec8bffac49@mail.gmail.com>

On Tue, 10 Jul 2007 23:21:49 -0400 "Cédric Augonnet" <cedric.augonnet@gmail.com> wrote:

> 2007/7/10, Andrew Morton <akpm@linux-foundation.org>:
> 
> Hi all,
> 
> > > +     size = sizeof(struct transaction_stats_s);
> > > +     s->stats = kmalloc(size, GFP_KERNEL);
> > > +     if (s == NULL) {
> > > +             kfree(s);
> > > +             return -EIO;
> >
> > ENOMEM
> 
> I'm sorry if i missed some point, but i just don't see the use of such
> a kfree here, not sure Andrew meant you should only return ENOMEM
> instead, but why issuing those kfree(NULL), instead of just a if (!s)
> return ENOMEM ?
> 

You found a bug.  It was meant to be

	if (s->stats == NULL)



  parent reply	other threads:[~2007-07-11  4:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-01  7:38 [EXT4 set 6][PATCH 1/1]Export jbd stats through procfs Mingming Cao
2007-07-01  9:26 ` Jose R. Santos
2007-07-11  2:31 ` Andrew Morton
2007-07-11  3:21   ` Cédric Augonnet
2007-07-11  4:37     ` Alexey Dobriyan
2007-07-11  4:42     ` Andrew Morton [this message]
2007-07-11  4:42       ` Andrew Morton
2007-07-11  2:21       ` Mingming Cao
2007-07-11  2:21         ` Mingming Cao
2007-07-16  8:26       ` Mingming Cao
2007-07-16  8:26         ` Mingming Cao
2007-07-16  8:24   ` Mingming Cao
2007-11-30 23:08 ` Eric Sandeen
2007-12-01  1:22   ` Mingming Cao

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=20070710214221.26539eb6.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=cedric.augonnet@gmail.com \
    --cc=cmm@us.ibm.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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.