diff mbox

ALSA: lola: NULL dereference on probe failure

Message ID 20141210130646.GA18593@mwanda (mailing list archive)
State Accepted
Commit feabb67e0eb0f509b530a56756ea44364843faea
Headers show

Commit Message

Dan Carpenter Dec. 10, 2014, 1:06 p.m. UTC
"card" is NULL if snd_card_new() fails.

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

Comments

Takashi Iwai Dec. 10, 2014, 1:45 p.m. UTC | #1
At Wed, 10 Dec 2014 16:06:46 +0300,
Dan Carpenter wrote:
> 
> "card" is NULL if snd_card_new() fails.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied, thanks.


Takashi

> 
> diff --git a/sound/pci/lola/lola.c b/sound/pci/lola/lola.c
> index a75c8dc..4cf4be5 100644
> --- a/sound/pci/lola/lola.c
> +++ b/sound/pci/lola/lola.c
> @@ -719,7 +719,7 @@ static int lola_probe(struct pci_dev *pci,
>  	err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
>  			   0, &card);
>  	if (err < 0) {
> -		dev_err(card->dev, "Error creating card!\n");
> +		dev_err(&pci->dev, "Error creating card!\n");
>  		return err;
>  	}
>  
>
diff mbox

Patch

diff --git a/sound/pci/lola/lola.c b/sound/pci/lola/lola.c
index a75c8dc..4cf4be5 100644
--- a/sound/pci/lola/lola.c
+++ b/sound/pci/lola/lola.c
@@ -719,7 +719,7 @@  static int lola_probe(struct pci_dev *pci,
 	err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
 			   0, &card);
 	if (err < 0) {
-		dev_err(card->dev, "Error creating card!\n");
+		dev_err(&pci->dev, "Error creating card!\n");
 		return err;
 	}