소스 검색

ALSA: pdaudiocf - Fix missing free in the error path

Added the missing snd_card_free() in the error path of probe callback.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai 16 년 전
부모
커밋
aa3d75d80d
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      sound/pcmcia/pdaudiocf/pdaudiocf.c

+ 3 - 1
sound/pcmcia/pdaudiocf/pdaudiocf.c

@@ -119,8 +119,10 @@ static int snd_pdacf_probe(struct pcmcia_device *link)
 	}
 
 	pdacf = snd_pdacf_create(card);
-	if (! pdacf)
+	if (!pdacf) {
+		snd_card_free(card);
 		return -EIO;
+	}
 
 	if (snd_device_new(card, SNDRV_DEV_LOWLEVEL, pdacf, &ops) < 0) {
 		kfree(pdacf);