From: Takashi Iwai Date: Thu, 17 Jul 2008 21:37:20 +0000 (+0200) Subject: ALSA: opti93x - Fix NULL dereference X-Git-Tag: v2.6.27-rc1~64^2~8 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=82af6bc0986c5140efc875b2d91326031f0254ab;p=linux-2.6-omap-h63xx.git ALSA: opti93x - Fix NULL dereference 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 Tested-by: Rene Herman Acked-by: Rene Herman Tested-by: Ingo Molnar Acked-by: Ingo Molnar --- diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c index 41c047e665e..d20abb28612 100644 --- a/sound/isa/opti9xx/opti92x-ad1848.c +++ b/sound/isa/opti9xx/opti92x-ad1848.c @@ -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); }