From: Greg Kroah-Hartman <gregkh@suse.de>
To: linux-kernel@vger.kernel.org
Cc: Ming Lei <tom.leiming@gmail.com>, Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH 2/5] driver core: firmware_class:fix memory leak of page pointers array
Date: Tue, 28 Jul 2009 14:44:38 -0700 [thread overview]
Message-ID: <1248817481-13372-2-git-send-email-gregkh@suse.de> (raw)
In-Reply-To: <20090728213826.GC13090@kroah.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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
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 f285f44..7376367 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.3.2
next prev parent reply other threads:[~2009-07-28 21:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-28 21:38 [GIT PATCH] driver core patches for 2.6.31-rc4-git Greg KH
2009-07-28 21:44 ` [PATCH 1/5] sysfs: fix hardlink count on device_move Greg Kroah-Hartman
2009-07-28 21:44 ` Greg Kroah-Hartman [this message]
2009-07-28 21:44 ` [PATCH 3/5] Dynamic debug: fix typo: -/-> Greg Kroah-Hartman
2009-07-28 21:44 ` [PATCH 4/5] driver core: sysdev: do not send KOBJ_ADD uevent if kobject_init_and_add fails Greg Kroah-Hartman
2009-07-28 21:44 ` [PATCH 5/5] driver core: documentation: make it clear that sysfs is optional Greg Kroah-Hartman
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=1248817481-13372-2-git-send-email-gregkh@suse.de \
--to=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=tom.leiming@gmail.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