public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: hdsp: fix memory leak
@ 2015-09-11 13:40 Sudip Mukherjee
  2015-09-11 15:35 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Sudip Mukherjee @ 2015-09-11 13:40 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai; +Cc: linux-kernel, alsa-devel, 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.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
 sound/pci/rme9652/hdsp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
index 9bba275..2875b4f 100644
--- a/sound/pci/rme9652/hdsp.c
+++ b/sound/pci/rme9652/hdsp.c
@@ -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;
 	}
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ALSA: hdsp: fix memory leak
  2015-09-11 13:40 [PATCH] ALSA: hdsp: fix memory leak Sudip Mukherjee
@ 2015-09-11 15:35 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2015-09-11 15:35 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: Jaroslav Kysela, alsa-devel, linux-kernel

On Fri, 11 Sep 2015 15:40:38 +0200,
Sudip Mukherjee wrote:
> 
> 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>

Applied, thanks.


Takashi

> ---
>  sound/pci/rme9652/hdsp.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
> index 9bba275..2875b4f 100644
> --- a/sound/pci/rme9652/hdsp.c
> +++ b/sound/pci/rme9652/hdsp.c
> @@ -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;
>  	}
>  
> -- 
> 1.9.1
> 
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-11 15:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-11 13:40 [PATCH] ALSA: hdsp: fix memory leak Sudip Mukherjee
2015-09-11 15:35 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox