Date: Fri, 13 May 2016 09:02:28 +0000 (UTC) From: Garrett Cooper <ngie@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r299633 - stable/9/sys/dev/sound/midi Message-ID: <201605130902.u4D92SOg074876@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ngie Date: Fri May 13 09:02:28 2016 New Revision: 299633 URL: https://svnweb.freebsd.org/changeset/base/299633 Log: MFstable/10 r299632: MFC r298339: r298339 (by cem): sound(4): Don't use-after-free in midi module unload Also, use ANSI function parameter definitions (void) while here. CID: 1006107 Modified: stable/9/sys/dev/sound/midi/midi.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/sound/midi/midi.c ============================================================================== --- stable/9/sys/dev/sound/midi/midi.c Fri May 13 09:01:20 2016 (r299632) +++ stable/9/sys/dev/sound/midi/midi.c Fri May 13 09:02:28 2016 (r299633) @@ -1397,7 +1397,7 @@ midi_destroy(struct snd_midi *m, int mid */ static int -midi_load() +midi_load(void) { mtx_init(&midistat_lock, "midistat lock", NULL, 0); TAILQ_INIT(&midi_devs); /* Initialize the queue. */ @@ -1410,9 +1410,9 @@ midi_load() } static int -midi_unload() +midi_unload(void) { - struct snd_midi *m; + struct snd_midi *m, *tmp; int retval; MIDI_DEBUG(1, printf("midi_unload()\n")); @@ -1421,7 +1421,7 @@ midi_unload() if (midistat_isopen) goto exit0; - TAILQ_FOREACH(m, &midi_devs, link) { + TAILQ_FOREACH_SAFE(m, &midi_devs, link, tmp) { mtx_lock(&m->lock); if (m->busy) retval = EBUSY;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605130902.u4D92SOg074876>