Messages in this thread Patch in this message | | | Date | Tue, 16 Sep 2003 18:18:08 +0800 | From | Wade <> | Subject | [PATCH] fix memleak in emu10k1/midi.c (was: Re: [CHECKER] 32 Memory Leaks on Error Paths) |
| |
David Yu Chen wrote: > Hi All, > [snip] > [FILE: 2.6.0-test5/sound/oss/emu10k1/midi.c] > [FUNC: emu10k1_seq_midi_open] > [LINES: 498-514] > [VAR: midi_dev] > 493: if (card->open_mode) /* card is opened native */ > 494: return -EBUSY; > 495: > 496: DPF(2, "emu10k1_seq_midi_open()\n"); > 497: > START --> > 498: if ((midi_dev = (struct emu10k1_mididevice *) kmalloc(sizeof(*midi_dev), GFP_KERNEL)) == NULL) > 499: return -EINVAL; > 500: > 501: midi_dev->card = card; > 502: midi_dev->mistate = MIDIIN_STATE_STOPPED; > 503: init_waitqueue_head(&midi_dev->oWait); > ... DELETED 5 lines ... > 509: > 510: dsCardMidiOpenInfo.refdata = (unsigned long) midi_dev; > 511: > 512: if (emu10k1_mpuout_open(card, &dsCardMidiOpenInfo) < 0) { > 513: ERROR(); > END --> > 514: return -ENODEV; > 515: } > 516: > 517: card->seq_mididev = midi_dev; > 518: > 519: return 0; > ---------------------------------------------------------
Can I ask again why the Checker is not released? I know that you don't have to release the source since you are not distributing it, but why not? AFAICS this would be a great asset to Open Source projects in general, not just the kernel.
(Patch correct? looked obvious)
--- linux-2.6.0-test5.old/sound/oss/emu10k1/midi.c 2003-09-09 21:24:39.000000000 +0800 +++ linux-2.6.0-test5.new/sound/oss/emu10k1/midi.c 2003-09-16 18:08:23.000000000 +0800 @@ -511,6 +511,7 @@ if (emu10k1_mpuout_open(card, &dsCardMidiOpenInfo) < 0) { ERROR(); + kfree(midi_dev); return -ENODEV; } | |