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

From: Ming Lei
Date: Wed Jul 08 2009 - 19:56:52 EST


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@xxxxxxxxx>
Reported-by:Catalin Marinas <catalin.marinas@xxxxxxx>
Acked-by: David Woodhouse <David.Woodhouse@xxxxxxxxx>
---
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/