Skip to contentSkip to conversation

sound/core/seq/seq_virmidi.c:192:6-12: preceding lock on line 176

PATCH Julia Lawall 2 participants 2 messages Feb 3, 2016 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 201602030826.fJM3cvVl%[email protected]

#1 lore raw

Looks suspicious, please check.

julia

Quoted 52 lines · kbuild test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git topic/core-fixes
head:   be33492635ee8fc19a185f37293b533069e5cc8f
commit: be33492635ee8fc19a185f37293b533069e5cc8f [21/21] ALSA: rawmidi: Make snd_rawmidi_transmit() race-free

:::::: branch date: 2 hours ago
:::::: commit date: 2 hours ago

Quoted 1 line
Quoted 1 line

sound/core/seq/seq_virmidi.c:192:6-12: preceding lock on line 176

git remote add sound https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
git remote update sound
git checkout be33492635ee8fc19a185f37293b533069e5cc8f
vim +192 sound/core/seq/seq_virmidi.c

^1da177e Linus Torvalds 2005-04-16  170  		if (vmidi->event.type != SNDRV_SEQ_EVENT_NONE) {
62c5549e Takashi Iwai   2006-02-22  171  			if (snd_seq_kernel_client_dispatch(vmidi->client, &vmidi->event, in_atomic(), 0) < 0)
^1da177e Linus Torvalds 2005-04-16  172  				return;
^1da177e Linus Torvalds 2005-04-16  173  			vmidi->event.type = SNDRV_SEQ_EVENT_NONE;
^1da177e Linus Torvalds 2005-04-16  174  		}
^1da177e Linus Torvalds 2005-04-16  175  		while (1) {
be334926 Takashi Iwai   2016-01-31 @176  			spin_lock_irqsave(&substream->runtime->lock, flags);
be334926 Takashi Iwai   2016-01-31  177  			count = __snd_rawmidi_transmit_peek(substream, buf, sizeof(buf));
^1da177e Linus Torvalds 2005-04-16  178  			if (count <= 0)
^1da177e Linus Torvalds 2005-04-16  179  				break;
^1da177e Linus Torvalds 2005-04-16  180  			pbuf = buf;
^1da177e Linus Torvalds 2005-04-16  181  			while (count > 0) {
^1da177e Linus Torvalds 2005-04-16  182  				res = snd_midi_event_encode(vmidi->parser, pbuf, count, &vmidi->event);
^1da177e Linus Torvalds 2005-04-16  183  				if (res < 0) {
^1da177e Linus Torvalds 2005-04-16  184  					snd_midi_event_reset_encode(vmidi->parser);
^1da177e Linus Torvalds 2005-04-16  185  					continue;
^1da177e Linus Torvalds 2005-04-16  186  				}
be334926 Takashi Iwai   2016-01-31  187  				__snd_rawmidi_transmit_ack(substream, res);
^1da177e Linus Torvalds 2005-04-16  188  				pbuf += res;
^1da177e Linus Torvalds 2005-04-16  189  				count -= res;
^1da177e Linus Torvalds 2005-04-16  190  				if (vmidi->event.type != SNDRV_SEQ_EVENT_NONE) {
62c5549e Takashi Iwai   2006-02-22  191  					if (snd_seq_kernel_client_dispatch(vmidi->client, &vmidi->event, in_atomic(), 0) < 0)
^1da177e Linus Torvalds 2005-04-16 @192  						return;
^1da177e Linus Torvalds 2005-04-16  193  					vmidi->event.type = SNDRV_SEQ_EVENT_NONE;
^1da177e Linus Torvalds 2005-04-16  194  				}
^1da177e Linus Torvalds 2005-04-16  195  			}

:::::: The code at line 192 was first introduced by commit :::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <[email protected]> :::::: CC: Linus Torvalds <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#2 lore raw
Quoted 2 lines · Julia Lawall

Looks suspicious, please check.

Thanks, it was being fixed just at this moment :)

Takashi

Quoted 58 lines

julia

Quoted 52 lines · kbuild test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git topic/core-fixes
head:   be33492635ee8fc19a185f37293b533069e5cc8f
commit: be33492635ee8fc19a185f37293b533069e5cc8f [21/21] ALSA: rawmidi: Make snd_rawmidi_transmit() race-free

:::::: branch date: 2 hours ago
:::::: commit date: 2 hours ago

Quoted 1 line
Quoted 1 line

sound/core/seq/seq_virmidi.c:192:6-12: preceding lock on line 176

git remote add sound https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
git remote update sound
git checkout be33492635ee8fc19a185f37293b533069e5cc8f
vim +192 sound/core/seq/seq_virmidi.c

^1da177e Linus Torvalds 2005-04-16  170  		if (vmidi->event.type != SNDRV_SEQ_EVENT_NONE) {
62c5549e Takashi Iwai   2006-02-22  171  			if (snd_seq_kernel_client_dispatch(vmidi->client, &vmidi->event, in_atomic(), 0) < 0)
^1da177e Linus Torvalds 2005-04-16  172  				return;
^1da177e Linus Torvalds 2005-04-16  173  			vmidi->event.type = SNDRV_SEQ_EVENT_NONE;
^1da177e Linus Torvalds 2005-04-16  174  		}
^1da177e Linus Torvalds 2005-04-16  175  		while (1) {
be334926 Takashi Iwai   2016-01-31 @176  			spin_lock_irqsave(&substream->runtime->lock, flags);
be334926 Takashi Iwai   2016-01-31  177  			count = __snd_rawmidi_transmit_peek(substream, buf, sizeof(buf));
^1da177e Linus Torvalds 2005-04-16  178  			if (count <= 0)
^1da177e Linus Torvalds 2005-04-16  179  				break;
^1da177e Linus Torvalds 2005-04-16  180  			pbuf = buf;
^1da177e Linus Torvalds 2005-04-16  181  			while (count > 0) {
^1da177e Linus Torvalds 2005-04-16  182  				res = snd_midi_event_encode(vmidi->parser, pbuf, count, &vmidi->event);
^1da177e Linus Torvalds 2005-04-16  183  				if (res < 0) {
^1da177e Linus Torvalds 2005-04-16  184  					snd_midi_event_reset_encode(vmidi->parser);
^1da177e Linus Torvalds 2005-04-16  185  					continue;
^1da177e Linus Torvalds 2005-04-16  186  				}
be334926 Takashi Iwai   2016-01-31  187  				__snd_rawmidi_transmit_ack(substream, res);
^1da177e Linus Torvalds 2005-04-16  188  				pbuf += res;
^1da177e Linus Torvalds 2005-04-16  189  				count -= res;
^1da177e Linus Torvalds 2005-04-16  190  				if (vmidi->event.type != SNDRV_SEQ_EVENT_NONE) {
62c5549e Takashi Iwai   2006-02-22  191  					if (snd_seq_kernel_client_dispatch(vmidi->client, &vmidi->event, in_atomic(), 0) < 0)
^1da177e Linus Torvalds 2005-04-16 @192  						return;
^1da177e Linus Torvalds 2005-04-16  193  					vmidi->event.type = SNDRV_SEQ_EVENT_NONE;
^1da177e Linus Torvalds 2005-04-16  194  				}
^1da177e Linus Torvalds 2005-04-16  195  			}

:::::: The code at line 192 was first introduced by commit :::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <[email protected]> :::::: CC: Linus Torvalds <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation