]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
firmware_class: fix memory leak - free allocated pages
authorDavid Woodhouse <David.Woodhouse@intel.com>
Sun, 2 May 2010 08:21:21 +0000 (11:21 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 2 Aug 2010 17:21:25 +0000 (10:21 -0700)
commite48db6326ecea360d79f42ec7fdaad53a328e362
tree366699420d3d46d046982ba6f61e1f9a4e7c36e5
parent46287c9a808ec7eb9f635f279474bdb1df2a8898
firmware_class: fix memory leak - free allocated pages

commit dd336c554d8926c3348a2d5f2a5ef5597f6d1a06 upstream.

fix memory leak introduced by the patch 6e03a201bbe:
firmware: speed up request_firmware()

1. vfree won't release pages there were allocated explicitly and mapped
using vmap. The memory has to be vunmap-ed and the pages needs
to be freed explicitly

2. page array is moved into the 'struct
firmware' so that we can free it from release_firmware()
and not only in fw_dev_release()

The fix doesn't break the firmware load speed.

Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Ming Lei <tom.leiming@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Singed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/base/firmware_class.c
include/linux/firmware.h