Skip to contentSkip to conversation

ALSA: hdsp: fix memory leak

PATCH Applied Sudip Mukherjee 2 participants 2 messages Sep 11, 2015 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: hdsp: fix memory leak

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.

---
 sound/pci/rme9652/hdsp.c | 1 +
 1 file changed, 1 insertion(+)
sound/pci/rme9652/hdsp.c +1 -0
index 9bba275..2875b4f 100644
@@ -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;
 	}
 
Signature · 1 line
1.9.1
Applied
#1 lore raw
Quoted 5 lines · Sudip Mukherjee

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.

Applied, thanks.

Takashi

Quoted 20 lines
---
 sound/pci/rme9652/hdsp.c | 1 +
 1 file changed, 1 insertion(+)
sound/pci/rme9652/hdsp.c +1 -0
index 9bba275..2875b4f 100644
@@ -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;
 	}
 
Signature · 1 line
1.9.1