linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: yidong zhang <zhangyd6@gmail.com>
To: Marco Stornelli <marco.stornelli@gmail.com>
Cc: linux-embedded@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, tim.bird@am.sony.com,
	akpm@linux-foundation.org
Subject: Re: [PATCH 02/16 v3] pramfs: super operations
Date: Mon, 15 Nov 2010 10:27:10 +0800	[thread overview]
Message-ID: <AANLkTiky=Vnxnav4VtX_Yd1sUtFGqHTrd=aih8qRJ7u7@mail.gmail.com> (raw)
In-Reply-To: <4CDEA53E.2050602@gmail.com>

hi Marco

> +       retval = 0;
> + out:
> +       if (retval && sbi->virt_addr) {
> +               iounmap(sbi->virt_addr);
> +               release_mem_region(sbi->phys_addr, initsize);
> +               kfree(sbi);
> +       }
> +
> +       return retval;
> +}
> +
  I think kfree(sbi) should not be put here. In case of
pram_parse_options failure, sbi should also be freed too.  How about
change it to the list below? And change some “goto out”   branches to
“goto out_free”.

 //    retval = 0;
     return 0;
 out:
       if (retval && sbi->virt_addr) {
               iounmap(sbi->virt_addr);
               release_mem_region(sbi->phys_addr, initsize);
       }
out_free:
               kfree(sbi);
       return retval;
}

  reply	other threads:[~2010-11-15  2:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-13 14:48 [PATCH 02/16 v3] pramfs: super operations Marco Stornelli
2010-11-15  2:27 ` yidong zhang [this message]
2010-11-15  7:45   ` Marco Stornelli

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='AANLkTiky=Vnxnav4VtX_Yd1sUtFGqHTrd=aih8qRJ7u7@mail.gmail.com' \
    --to=zhangyd6@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-embedded@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marco.stornelli@gmail.com \
    --cc=tim.bird@am.sony.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;
as well as URLs for NNTP newsgroup(s).