driver core: firmware_class:fix memory leak of page pointers array
authorMing Lei <tom.leiming@gmail.com>
Sat, 11 Jul 2009 03:11:10 +0000 (11:11 +0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 28 Jul 2009 20:45:22 +0000 (13:45 -0700)
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

index f285f441fab9d20dbf050d61e4360759b0fbe1fb..7376367bcb8053dec4951945f916d47c882fd59a 100644 (file)
@@ -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);