All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: sparc: Add missing kfree in error path
@ 2015-07-17 18:33 ` Christophe JAILLET
  0 siblings, 0 replies; 5+ messages in thread
From: Christophe JAILLET @ 2015-07-17 18:33 UTC (permalink / raw)
  To: perex, tiwai
  Cc: alsa-devel, linux-kernel, kernel-janitors, Christophe JAILLET

If 'of_ioremap' fails, then 'amd' should be freed, otherwise, there is a
memory leak.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 sound/sparc/amd7930.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/sparc/amd7930.c b/sound/sparc/amd7930.c
index 1b1a89e..784ceb8 100644
--- a/sound/sparc/amd7930.c
+++ b/sound/sparc/amd7930.c
@@ -956,6 +956,7 @@ static int snd_amd7930_create(struct snd_card *card,
 	if (!amd->regs) {
 		snd_printk(KERN_ERR
 			   "amd7930-%d: Unable to map chip registers.\n", dev);
+		kfree(amd);
 		return -EIO;
 	}
 
-- 
2.1.4


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

* [PATCH] ALSA: sparc: Add missing kfree in error path
@ 2015-07-17 18:33 ` Christophe JAILLET
  0 siblings, 0 replies; 5+ messages in thread
From: Christophe JAILLET @ 2015-07-17 18:33 UTC (permalink / raw)
  To: perex, tiwai
  Cc: alsa-devel, linux-kernel, kernel-janitors, Christophe JAILLET

If 'of_ioremap' fails, then 'amd' should be freed, otherwise, there is a
memory leak.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 sound/sparc/amd7930.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/sparc/amd7930.c b/sound/sparc/amd7930.c
index 1b1a89e..784ceb8 100644
--- a/sound/sparc/amd7930.c
+++ b/sound/sparc/amd7930.c
@@ -956,6 +956,7 @@ static int snd_amd7930_create(struct snd_card *card,
 	if (!amd->regs) {
 		snd_printk(KERN_ERR
 			   "amd7930-%d: Unable to map chip registers.\n", dev);
+		kfree(amd);
 		return -EIO;
 	}
 
-- 
2.1.4


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

* Re: [PATCH] ALSA: sparc: Add missing kfree in error path
  2015-07-17 18:33 ` Christophe JAILLET
  (?)
@ 2015-07-17 20:30   ` Takashi Iwai
  -1 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2015-07-17 20:30 UTC (permalink / raw)
  To: Christophe JAILLET; +Cc: perex, alsa-devel, kernel-janitors, linux-kernel

On Fri, 17 Jul 2015 20:33:21 +0200,
Christophe JAILLET wrote:
> 
> If 'of_ioremap' fails, then 'amd' should be freed, otherwise, there is a
> memory leak.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Applied, thanks.


Takashi

> ---
>  sound/sparc/amd7930.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/sound/sparc/amd7930.c b/sound/sparc/amd7930.c
> index 1b1a89e..784ceb8 100644
> --- a/sound/sparc/amd7930.c
> +++ b/sound/sparc/amd7930.c
> @@ -956,6 +956,7 @@ static int snd_amd7930_create(struct snd_card *card,
>  	if (!amd->regs) {
>  		snd_printk(KERN_ERR
>  			   "amd7930-%d: Unable to map chip registers.\n", dev);
> +		kfree(amd);
>  		return -EIO;
>  	}
>  
> -- 
> 2.1.4
> 
> 

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

* Re: [PATCH] ALSA: sparc: Add missing kfree in error path
@ 2015-07-17 20:30   ` Takashi Iwai
  0 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2015-07-17 20:30 UTC (permalink / raw)
  To: Christophe JAILLET; +Cc: perex, alsa-devel, kernel-janitors, linux-kernel

On Fri, 17 Jul 2015 20:33:21 +0200,
Christophe JAILLET wrote:
> 
> If 'of_ioremap' fails, then 'amd' should be freed, otherwise, there is a
> memory leak.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Applied, thanks.


Takashi

> ---
>  sound/sparc/amd7930.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/sound/sparc/amd7930.c b/sound/sparc/amd7930.c
> index 1b1a89e..784ceb8 100644
> --- a/sound/sparc/amd7930.c
> +++ b/sound/sparc/amd7930.c
> @@ -956,6 +956,7 @@ static int snd_amd7930_create(struct snd_card *card,
>  	if (!amd->regs) {
>  		snd_printk(KERN_ERR
>  			   "amd7930-%d: Unable to map chip registers.\n", dev);
> +		kfree(amd);
>  		return -EIO;
>  	}
>  
> -- 
> 2.1.4
> 
> 

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

* Re: [PATCH] ALSA: sparc: Add missing kfree in error path
@ 2015-07-17 20:30   ` Takashi Iwai
  0 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2015-07-17 20:30 UTC (permalink / raw)
  To: Christophe JAILLET; +Cc: perex, alsa-devel, kernel-janitors, linux-kernel

On Fri, 17 Jul 2015 20:33:21 +0200,
Christophe JAILLET wrote:
> 
> If 'of_ioremap' fails, then 'amd' should be freed, otherwise, there is a
> memory leak.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Applied, thanks.


Takashi

> ---
>  sound/sparc/amd7930.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/sound/sparc/amd7930.c b/sound/sparc/amd7930.c
> index 1b1a89e..784ceb8 100644
> --- a/sound/sparc/amd7930.c
> +++ b/sound/sparc/amd7930.c
> @@ -956,6 +956,7 @@ static int snd_amd7930_create(struct snd_card *card,
>  	if (!amd->regs) {
>  		snd_printk(KERN_ERR
>  			   "amd7930-%d: Unable to map chip registers.\n", dev);
> +		kfree(amd);
>  		return -EIO;
>  	}
>  
> -- 
> 2.1.4
> 
> 

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

end of thread, other threads:[~2015-07-17 20:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-17 18:33 [PATCH] ALSA: sparc: Add missing kfree in error path Christophe JAILLET
2015-07-17 18:33 ` Christophe JAILLET
2015-07-17 20:30 ` Takashi Iwai
2015-07-17 20:30   ` Takashi Iwai
2015-07-17 20:30   ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.