Commit 3b4418c6 authored by Ming Lei's avatar Ming Lei Committed by Greg Kroah-Hartman

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: default avatarMing Lei <tom.leiming@gmail.com>
Reported-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Acked-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 0f58b445
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment