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)
spin_unlock_irqrestore(&dmap->lock,flags);
timeout = interruptible_sleep_on_timeout(&adev->in_sleeper,
timeout);
spin_lock_irqsave(&dmap->lock,flags);
if (!timeout) {
/* FIXME: include device name */
err = -EIO;
......@@ -595,6 +594,7 @@ int DMAbuf_getrdbuffer(int dev, char **buf, int *len, int dontblock)
dma_reset_input(dev);
} else
err = -EINTR;
spin_lock_irqsave(&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