include/linux/firmware.h: Define COMEDI_RELEASE_FIRMWARE_NOWAIT(fw)
authorIan Abbott <abbotti@mev.co.uk>
Thu, 31 May 2012 08:55:02 +0000 (09:55 +0100)
committerIan Abbott <abbotti@mev.co.uk>
Thu, 31 May 2012 08:55:02 +0000 (09:55 +0100)
commit7fd5baebc81f2ad9206abea8ea06463865f1adc8
treeb643a6eebdfbec95d14d4f4717667e32ca0c94e0
parentdc38fa42e2f688bdb3ba55468c74b3379feb49cc
include/linux/firmware.h: Define COMEDI_RELEASE_FIRMWARE_NOWAIT(fw)

The version of request_firmware_nowait() that takes a gfp_t parameter
also expects its callback function to call release_firmware() to free
the firmware, otherwise there is a memory leak.  The older version of
request_firmware_nowait() doesn't want the callback function to free the
firmware.  Define the macro COMEDI_RELEASE_FIRMWARE_NOWAIT(fw) to be
used in the callback function instead of calling release_firmware(fw)
directly.  This does nothing for the older request_firmware_nowait()
API, but calls release_firmware(fw) for the newer
request_firmware_nowait() API.

Change the request_firmware_nowait callback function in the usbdux,
usbduxfast and usbduxsigma drivers to use
COMEDI_RELEASE_FIRMWARE_NOWAIT().

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
comedi/drivers/usbdux.c
comedi/drivers/usbduxfast.c
comedi/drivers/usbduxsigma.c
include/linux/firmware.h