ALSA: opti93x - Fix NULL dereference
authorTakashi Iwai <tiwai@suse.de>
Thu, 17 Jul 2008 21:37:20 +0000 (23:37 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 18 Jul 2008 09:59:40 +0000 (11:59 +0200)
Probing non-existing device causes Oops with snd-opti93x driver
due to NULL access in the destructor of the error path.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Tested-by: Rene Herman <rene.herman@gmail.com>
Acked-by: Rene Herman <rene.herman@gmail.com>
Tested-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Ingo Molnar <mingo@elte.hu>
sound/isa/opti9xx/opti92x-ad1848.c

index 41c047e665ec7d62c6f85c25dbf45ce1441e901f..d20abb28612456b9fec090da7d7cb007d0f541b9 100644 (file)
@@ -688,7 +688,7 @@ static void snd_card_opti9xx_free(struct snd_card *card)
        if (chip) {
 #ifdef OPTi93X
                struct snd_cs4231 *codec = chip->codec;
-               if (codec->irq > 0) {
+               if (codec && codec->irq > 0) {
                        disable_irq(codec->irq);
                        free_irq(codec->irq, codec);
                }