summaryrefslogtreecommitdiff
path: root/sound/core/rawmidi.c
diff options
context:
space:
mode:
authorSrinivasa Rao Kuppala <srkupp@codeaurora.org>2018-05-30 12:22:02 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2018-06-18 03:42:54 -0700
commit2763b994a1a1145eb8d538b35e7bab5156e1e351 (patch)
treecd48bd13d2ae9bba7d0487a6fa2c2edc4629e6d0 /sound/core/rawmidi.c
parent2df37432879423de0fd90bc659a1b3369abf1951 (diff)
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: Srinivasa Rao Kuppala <srkupp@codeaurora.org>
Diffstat (limited to 'sound/core/rawmidi.c')
-rw-r--r--sound/core/rawmidi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
index 514380104944..180261da33c9 100644
--- a/sound/core/rawmidi.c
+++ b/sound/core/rawmidi.c
@@ -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)