[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20100712182910.7b69b493.akpm@linux-foundation.org>
Date: Mon, 12 Jul 2010 18:29:10 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: axel.lin@...il.com
Cc: linux-kernel <linux-kernel@...r.kernel.org>,
Stephen Hemminger <shemminger@...tta.com>,
Jens Axboe <jens.axboe@...cle.com>,
David Teigland <teigland@...hat.com>,
Pekka Enberg <penberg@...helsinki.fi>,
"Hans J. Koch" <hjk@...utronix.de>
Subject: Re: [PATCH] edd: fix possible memory leak in edd_init() error path
On Tue, 13 Jul 2010 09:17:58 +0800 Axel Lin <axel.lin@...il.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;
}
_
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists