ALSA: hdsp: fix memory leak
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Fri, 11 Sep 2015 13:40:38 +0000 (19:10 +0530)
committerTakashi Iwai <tiwai@suse.de>
Fri, 11 Sep 2015 15:35:11 +0000 (17:35 +0200)
If the size of the firmware is less than expected size then we are
exiting with the error code but we missed releasing the firmware.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/rme9652/hdsp.c

index 9bba275b4c9b08ba3dd4ff763afd6b17669af48d..2875b4f6d8c9e6a792638547d4b6850fa620a857 100644 (file)
@@ -5112,6 +5112,7 @@ static int hdsp_request_fw_loader(struct hdsp *hdsp)
                dev_err(hdsp->card->dev,
                        "too short firmware size %d (expected %d)\n",
                           (int)fw->size, HDSP_FIRMWARE_SIZE);
+               release_firmware(fw);
                return -EINVAL;
        }