Commit c8800d33 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] OSS dmabuf deadlock fix

Spotted by From: Christian Borntraeger <kernel@borntraeger.net>

dma_reset_input() takes dmap->lock, so call it without that lock held.
parent 9a981cd1
...@@ -587,7 +587,6 @@ int DMAbuf_getrdbuffer(int dev, char **buf, int *len, int dontblock) ...@@ -587,7 +587,6 @@ int DMAbuf_getrdbuffer(int dev, char **buf, int *len, int dontblock)
spin_unlock_irqrestore(&dmap->lock,flags); spin_unlock_irqrestore(&dmap->lock,flags);
timeout = interruptible_sleep_on_timeout(&adev->in_sleeper, timeout = interruptible_sleep_on_timeout(&adev->in_sleeper,
timeout); timeout);
spin_lock_irqsave(&dmap->lock,flags);
if (!timeout) { if (!timeout) {
/* FIXME: include device name */ /* FIXME: include device name */
err = -EIO; err = -EIO;
...@@ -595,6 +594,7 @@ int DMAbuf_getrdbuffer(int dev, char **buf, int *len, int dontblock) ...@@ -595,6 +594,7 @@ int DMAbuf_getrdbuffer(int dev, char **buf, int *len, int dontblock)
dma_reset_input(dev); dma_reset_input(dev);
} else } else
err = -EINTR; err = -EINTR;
spin_lock_irqsave(&dmap->lock,flags);
} }
spin_unlock_irqrestore(&dmap->lock,flags); spin_unlock_irqrestore(&dmap->lock,flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment