alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [patch] ALSA: lola: NULL deref on allocation error
@ 2014-03-05 10:55 Dan Carpenter
  2014-03-05 11:11 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2014-03-05 10:55 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: Takashi Iwai, alsa-devel, kernel-janitors

"chip" is NULL here.  We don't need a printk here because kmalloc() has
it built in.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/sound/pci/lola/lola.c b/sound/pci/lola/lola.c
index d63434d8c3fb..68824cdd137d 100644
--- a/sound/pci/lola/lola.c
+++ b/sound/pci/lola/lola.c
@@ -586,7 +586,6 @@ static int lola_create(struct snd_card *card, struct pci_dev *pci,
 
 	chip = kzalloc(sizeof(*chip), GFP_KERNEL);
 	if (!chip) {
-		dev_err(chip->card->dev, "cannot allocate chip\n");
 		pci_disable_device(pci);
 		return -ENOMEM;
 	}

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

* Re: [patch] ALSA: lola: NULL deref on allocation error
  2014-03-05 10:55 [patch] ALSA: lola: NULL deref on allocation error Dan Carpenter
@ 2014-03-05 11:11 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2014-03-05 11:11 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Jaroslav Kysela, alsa-devel, kernel-janitors

At Wed, 5 Mar 2014 13:55:09 +0300,
Dan Carpenter wrote:
> 
> "chip" is NULL here.  We don't need a printk here because kmalloc() has
> it built in.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks, applied.


Takashi

> 
> diff --git a/sound/pci/lola/lola.c b/sound/pci/lola/lola.c
> index d63434d8c3fb..68824cdd137d 100644
> --- a/sound/pci/lola/lola.c
> +++ b/sound/pci/lola/lola.c
> @@ -586,7 +586,6 @@ static int lola_create(struct snd_card *card, struct pci_dev *pci,
>  
>  	chip = kzalloc(sizeof(*chip), GFP_KERNEL);
>  	if (!chip) {
> -		dev_err(chip->card->dev, "cannot allocate chip\n");
>  		pci_disable_device(pci);
>  		return -ENOMEM;
>  	}
> 

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

end of thread, other threads:[~2014-03-05 11:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-05 10:55 [patch] ALSA: lola: NULL deref on allocation error Dan Carpenter
2014-03-05 11:11 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).