From: Ming Lei <tom.leiming@gmail.com>
To: Greg KH <greg@kroah.com>
Cc: linux-kernel@vger.kernel.org, catalin.marinas@arm.com,
dwmw2@infradead.org, kay.sievers@vrfy.org
Subject: Re: [PATCH] driver core:firmware_class:fix memory leak of page pointers array
Date: Sat, 11 Jul 2009 11:11:10 +0800 [thread overview]
Message-ID: <20090711111110.6be67d82@linux-lm> (raw)
In-Reply-To: <20090710173649.GB3687@kroah.com>
于 Fri, 10 Jul 2009 10:36:49 -0700
Greg KH <greg@kroah.com> 写道:
> On Thu, Jul 09, 2009 at 08:20:48AM +0800, Ming Lei wrote:
> > 2009/7/9 <tom.leiming@gmail.com>:
> > > From: Ming Lei <tom.leiming@gmail.com>
> > >
> > > The page pointers array is allocated in fw_realloc_buffer()
> > > called by firmware_data_write(), and should be freed in release
> > > function of firmware device.
> > >
> > > Signed-off-by:Ming Lei <tom.leiming@gmail.com>
> > > Reported-by:Catalin Marinas <catalin.marinas@arm.com>
> > > Acked-by: David Woodhouse <David.Woodhouse@intel.com>
> >
> > ---
> > This patch is against Catalin Marinas's patch:
> > [PATCH] Free struct device in fw_dev_release()
>
> Hm, I never got a final version of that patch, care to send it to me?
It is the latest version and now is against linus mainline.
Thanks.
>From 50603673f5c68eb843584e65cc9930919910f98a Mon Sep 17 00:00:00 2001
From: Ming Lei <tom.leiming@gmail.com>
Date: Thu, 9 Jul 2009 07:56:52 +0800
Subject: [PATCH] driver core:firmware_class:fix memory leak of page pointers array
The page pointers array is allocated in fw_realloc_buffer() called by
firmware_data_write(), and should be freed in release function of firmware
device.
Signed-off-by:Ming Lei <tom.leiming@gmail.com>
Reported-by:Catalin Marinas <catalin.marinas@arm.com>
Acked-by: David Woodhouse <David.Woodhouse@intel.com>
---
drivers/base/firmware_class.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index fc46653..2643366 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -180,7 +180,6 @@ static ssize_t firmware_loading_store(struct device *dev,
goto err;
}
/* Pages will be freed by vfree() */
- fw_priv->pages = NULL;
fw_priv->page_array_size = 0;
fw_priv->nr_pages = 0;
complete(&fw_priv->completion);
--
1.6.0.GIT
--
Lei Ming
next prev parent reply other threads:[~2009-07-11 3:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-09 0:16 [PATCH] driver core:firmware_class:fix memory leak of page pointers array tom.leiming
2009-07-09 0:20 ` Ming Lei
2009-07-10 17:36 ` Greg KH
2009-07-11 3:11 ` Ming Lei [this message]
2009-07-16 13:22 ` Ming Lei
2009-07-16 22:41 ` Greg KH
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=20090711111110.6be67d82@linux-lm \
--to=tom.leiming@gmail.com \
--cc=catalin.marinas@arm.com \
--cc=dwmw2@infradead.org \
--cc=greg@kroah.com \
--cc=kay.sievers@vrfy.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox