Skip to contentSkip to conversation

ALSA: pcxhr: NULL dereference on probe failure

PATCH Applied Dan Carpenter 2 participants 2 messages Dec 10, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: pcxhr: NULL dereference on probe failure

"card" is NULL if snd_card_new() fails.

sound/pci/pcxhr/pcxhr.c +1 -1
index a602930..c6092e4 100644
@@ -1638,7 +1638,7 @@ static int pcxhr_probe(struct pci_dev *pci,
 				   0, &card);
 
 		if (err < 0) {
-			dev_err(card->dev, "cannot allocate the card %d\n", i);
+			dev_err(&pci->dev, "cannot allocate the card %d\n", i);
 			pcxhr_free(mgr);
 			return err;
 		}
Applied
#1 lore raw

At Wed, 10 Dec 2014 16:26:21 +0300,

Quoted 4 lines · Dan Carpenter

"card" is NULL if snd_card_new() fails.

Applied, thanks.

Takashi

Quoted 15 lines
sound/pci/pcxhr/pcxhr.c +1 -1
index a602930..c6092e4 100644
@@ -1638,7 +1638,7 @@ static int pcxhr_probe(struct pci_dev *pci,
 				   0, &card);
 
 		if (err < 0) {
-			dev_err(card->dev, "cannot allocate the card %d\n", i);
+			dev_err(&pci->dev, "cannot allocate the card %d\n", i);
 			pcxhr_free(mgr);
 			return err;
 		}