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

Commit 100451bd authored by Srinivasa Rao Kuppala's avatar Srinivasa Rao Kuppala Committed by Gerrit - the friendly Code Review server
Browse files

sound: rawmidi: Move spinlock under realloc_mutex



A merge conflict resolution of commit e57f781805f0 ("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: I29723c5623db3b7145644f941ccc5226e3764f08
Signed-off-by: default avatarSrinivasa Rao Kuppala <srkupp@codeaurora.org>
parent 58b2ea36
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -986,9 +986,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)