The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Andreas Platschek <andi.platschek@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] driver-core: only call kfree() if memory was allocated
Date: Sat, 3 Aug 2013 17:22:31 +0800	[thread overview]
Message-ID: <20130803092231.GA1870@kroah.com> (raw)
In-Reply-To: <20130802220445.GA22019@kroah.com>

On Sat, Aug 03, 2013 at 06:04:45AM +0800, Greg KH wrote:
> On Fri, Aug 02, 2013 at 11:43:50PM +0200, Andreas Platschek wrote:
> > There are several cases where we could bail out of show_uevent()
> > before kzalloc() is even called. In those cases we don't want to
> > call kfree().
> 
> Why not?  It's totally safe to do that.
> 
> > In addition the error handling of kzalloc() is now using the
> > single point of exit as well.
> 
> We had the single point of exit to start with, there's no change made
> there.

Oops, no, you are correct about that one, but it's not really a big deal
for such a small function.

greg k-h

      reply	other threads:[~2013-08-03  9:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-02 21:43 [PATCH] driver-core: only call kfree() if memory was allocated Andreas Platschek
2013-08-02 22:04 ` Greg KH
2013-08-03  9:22   ` Greg KH [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=20130803092231.GA1870@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=andi.platschek@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox