[patch, 2.4] esssolo1.c doesn't free resources correctly

Marcus Alanen (maalanen@ra.abo.fi)
Mon, 1 Jul 2002 20:47:56 +0300 (EEST)


In drivers/sound/esssolo1.c, a failed solo1_probe() frees resources in
the wrong order (Look at the allocation order). Also, the wrong
unregister_sound_* routines are used.

I don't know if register_sound_special should use unit 10 ("dmfm")
instead of 15 ("unknown").

Compiles, not tested.

Marcus

===== drivers/sound/esssolo1.c 1.11 vs edited =====
--- 1.11/drivers/sound/esssolo1.c Fri Mar 29 01:00:15 2002
+++ edited/drivers/sound/esssolo1.c Mon Jul 1 20:21:52 2002
@@ -2377,9 +2377,9 @@
return 0;

err:
- unregister_sound_dsp(s->dev_dmfm);
+ unregister_sound_special(s->dev_dmfm);
err_dev4:
- unregister_sound_dsp(s->dev_midi);
+ unregister_sound_midi(s->dev_midi);
err_dev3:
unregister_sound_mixer(s->dev_mixer);
err_dev2:
@@ -2390,13 +2390,13 @@
err_irq:
if (s->gameport.io)
release_region(s->gameport.io, GAMEPORT_EXTENT);
- release_region(s->iobase, IOBASE_EXTENT);
+ release_region(s->mpubase, MPUBASE_EXTENT);
err_region4:
- release_region(s->sbbase+FMSYNTH_EXTENT, SBBASE_EXTENT-FMSYNTH_EXTENT);
- err_region3:
release_region(s->ddmabase, DDMABASE_EXTENT);
+ err_region3:
+ release_region(s->sbbase+FMSYNTH_EXTENT, SBBASE_EXTENT-FMSYNTH_EXTENT);
err_region2:
- release_region(s->mpubase, MPUBASE_EXTENT);
+ release_region(s->iobase, IOBASE_EXTENT);
err_region1:
kfree(s);
return ret;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/