public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: axel.lin@gmail.com
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	Stephen Hemminger <shemminger@vyatta.com>,
	Jens Axboe <jens.axboe@oracle.com>,
	David Teigland <teigland@redhat.com>,
	Pekka Enberg <penberg@cs.helsinki.fi>,
	"Hans J. Koch" <hjk@linutronix.de>
Subject: Re: [PATCH] edd: fix possible memory leak in edd_init() error path
Date: Mon, 12 Jul 2010 18:29:10 -0700	[thread overview]
Message-ID: <20100712182910.7b69b493.akpm@linux-foundation.org> (raw)
In-Reply-To: <AANLkTik3qDmpRS9HwFFzCfyHMrUd9ZnaR1A39jUo0cbt@mail.gmail.com>

On Tue, 13 Jul 2010 09:17:58 +0800 Axel Lin <axel.lin@gmail.com> wrote:

> >> +
> >> +out:
> >> + __ __ while (--i >= 0) {
> >> + __ __ __ __ __ __ edev = edd_devices[i];
> >> + __ __ __ __ __ __ if (edev)
> >
> > This test is unneeded?
> 
> right. a revised version is on the way.

I already did the below, which you were cc'ed on?

--- a/drivers/firmware/edd.c~edd-fix-possible-memory-leak-in-edd_init-error-path-fix
+++ a/drivers/firmware/edd.c
@@ -778,11 +778,8 @@ edd_init(void)
 	return 0;
 
 out:
-	while (--i >= 0) {
-		edev = edd_devices[i];
-		if (edev)
-			edd_device_unregister(edev);
-	}
+	while (--i >= 0)
+		edd_device_unregister(edd_devices[i]);
 	kset_unregister(edd_kset);
 	return rc;
 }
_


      reply	other threads:[~2010-07-13  1:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-09 10:50 [PATCH] edd: fix possible memory leak in edd_init() error path Axel Lin
2010-07-11  9:01 ` Pekka Enberg
2010-07-12 19:49 ` Andrew Morton
2010-07-13  1:17   ` Axel Lin
2010-07-13  1:29     ` Andrew Morton [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=20100712182910.7b69b493.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=axel.lin@gmail.com \
    --cc=hjk@linutronix.de \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penberg@cs.helsinki.fi \
    --cc=shemminger@vyatta.com \
    --cc=teigland@redhat.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