firmware: Free temporary page table after vmapping
Once after performing vmap() to map the S/G pages, our own page table becomes superfluous since the pages can be released via vfree() automatically. Let's change the buffer release code and discard the page table array for saving some memory. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
64ae0e71c6
commit
ddaf29fd9b
@@ -252,13 +252,13 @@ static void __free_fw_priv(struct kref *ref)
|
||||
spin_unlock(&fwc->lock);
|
||||
|
||||
#ifdef CONFIG_FW_LOADER_USER_HELPER
|
||||
if (fw_priv->is_paged_buf) {
|
||||
if (fw_priv->pages) {
|
||||
/* free leftover pages */
|
||||
int i;
|
||||
vunmap(fw_priv->data);
|
||||
for (i = 0; i < fw_priv->nr_pages; i++)
|
||||
__free_page(fw_priv->pages[i]);
|
||||
vfree(fw_priv->pages);
|
||||
} else
|
||||
}
|
||||
#endif
|
||||
if (!fw_priv->allocated_size)
|
||||
vfree(fw_priv->data);
|
||||
|
Reference in New Issue
Block a user