Re: [PATCH] driver core:firmware_class:fix memory leak of page pointers array

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Ming Lei
Date: Friday, July 10, 2009 - 8:11 pm

于 Fri, 10 Jul 2009 10:36:49 -0700
Greg KH <greg@kroah.com> 写道:


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
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] driver core:firmware_class:fix memory leak of ..., Ming Lei, (Fri Jul 10, 8:11 pm)