Commit 82af6bc0986c5140efc875b2d91326031f0254ab

Authored by Takashi Iwai
1 parent 2522d73593

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 <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>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

sound/isa/opti9xx/opti92x-ad1848.c
... ... @@ -688,7 +688,7 @@
688 688 if (chip) {
689 689 #ifdef OPTi93X
690 690 struct snd_cs4231 *codec = chip->codec;
691   - if (codec->irq > 0) {
  691 + if (codec && codec->irq > 0) {
692 692 disable_irq(codec->irq);
693 693 free_irq(codec->irq, codec);
694 694 }