]> git.baikalelectronics.ru Git - kernel.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>
Fri, 21 May 2010 16:37:28 +0000 (09:37 -0700)
commit8ed84fe7d966639909c6e144348b132e249f57a3
tree457178c0d3189d6c3e02922aca36e528f4fc50a9
parent1347bf5347b561ad65d440a8b785edd5f7012fd2
firmware_class: fix memory leak - free allocated pages

fix memory leak introduced by the patch a072ec61aa1:
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