Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0377c063 authored by Dennis Cagle's avatar Dennis Cagle
Browse files

sound: rawmidi: Move spinlock under realloc_mutex



A merge conflict resolution of commit e57f7818 ("ANDROID: sound:
rawmidi: Hold lock around realloc") placed a realloc_mutex lock
inside of a runtime->lock irq spinlock. The mutex lock has to
encompass the spinlock to avoid attempts to sleep in an invalid
context.

Change-Id: I9333a01615c54fea3788f32955f40ae4b7a812a0
Signed-off-by: default avatarDennis Cagle <dcagle@codeaurora.org>
parent ccf21f85
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -976,9 +976,9 @@ static long snd_rawmidi_kernel_read1(struct snd_rawmidi_substream *substream,
	struct snd_rawmidi_runtime *runtime = substream->runtime;
	unsigned long appl_ptr;

	spin_lock_irqsave(&runtime->lock, flags);
	if (userbuf)
		mutex_lock(&runtime->realloc_mutex);
	spin_lock_irqsave(&runtime->lock, flags);
	while (count > 0 && runtime->avail) {
		count1 = runtime->buffer_size - runtime->appl_ptr;
		if (count1 > count)