Commit 8ce9a75a authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'core-fixes-for-linus' of...

Merge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  iommu: fix Intel IOMMU write-buffer flushing
  futex: fix reference leak

Trivial conflicts fixed manually in drivers/pci/intel-iommu.c
parents b30b7749 9af88143
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
/* global iommu list, set NULL for ignored DMAR units */ /* global iommu list, set NULL for ignored DMAR units */
static struct intel_iommu **g_iommus; static struct intel_iommu **g_iommus;
static int rwbf_quirk = 0; static int rwbf_quirk;
/* /*
* 0: Present * 0: Present
...@@ -3142,8 +3142,10 @@ static struct iommu_ops intel_iommu_ops = { ...@@ -3142,8 +3142,10 @@ static struct iommu_ops intel_iommu_ops = {
static void __devinit quirk_iommu_rwbf(struct pci_dev *dev) static void __devinit quirk_iommu_rwbf(struct pci_dev *dev)
{ {
/* Mobile 4 Series Chipset neglects to set RWBF capability, /*
but needs it */ * Mobile 4 Series Chipset neglects to set RWBF capability,
* but needs it:
*/
printk(KERN_INFO "DMAR: Forcing write-buffer flush capability\n"); printk(KERN_INFO "DMAR: Forcing write-buffer flush capability\n");
rwbf_quirk = 1; rwbf_quirk = 1;
} }
......
...@@ -1165,6 +1165,7 @@ static int futex_wait(u32 __user *uaddr, int fshared, ...@@ -1165,6 +1165,7 @@ static int futex_wait(u32 __user *uaddr, int fshared,
u32 val, ktime_t *abs_time, u32 bitset, int clockrt) u32 val, ktime_t *abs_time, u32 bitset, int clockrt)
{ {
struct task_struct *curr = current; struct task_struct *curr = current;
struct restart_block *restart;
DECLARE_WAITQUEUE(wait, curr); DECLARE_WAITQUEUE(wait, curr);
struct futex_hash_bucket *hb; struct futex_hash_bucket *hb;
struct futex_q q; struct futex_q q;
...@@ -1216,11 +1217,13 @@ static int futex_wait(u32 __user *uaddr, int fshared, ...@@ -1216,11 +1217,13 @@ static int futex_wait(u32 __user *uaddr, int fshared,
if (!ret) if (!ret)
goto retry; goto retry;
return ret; goto out;
} }
ret = -EWOULDBLOCK; ret = -EWOULDBLOCK;
if (uval != val) if (unlikely(uval != val)) {
goto out_unlock_put_key; queue_unlock(&q, hb);
goto out_put_key;
}
/* Only actually queue if *uaddr contained val. */ /* Only actually queue if *uaddr contained val. */
queue_me(&q, hb); queue_me(&q, hb);
...@@ -1284,19 +1287,21 @@ static int futex_wait(u32 __user *uaddr, int fshared, ...@@ -1284,19 +1287,21 @@ static int futex_wait(u32 __user *uaddr, int fshared,
*/ */
/* If we were woken (and unqueued), we succeeded, whatever. */ /* If we were woken (and unqueued), we succeeded, whatever. */
ret = 0;
if (!unqueue_me(&q)) if (!unqueue_me(&q))
return 0; goto out_put_key;
ret = -ETIMEDOUT;
if (rem) if (rem)
return -ETIMEDOUT; goto out_put_key;
/* /*
* We expect signal_pending(current), but another thread may * We expect signal_pending(current), but another thread may
* have handled it for us already. * have handled it for us already.
*/ */
ret = -ERESTARTSYS;
if (!abs_time) if (!abs_time)
return -ERESTARTSYS; goto out_put_key;
else {
struct restart_block *restart;
restart = &current_thread_info()->restart_block; restart = &current_thread_info()->restart_block;
restart->fn = futex_wait_restart; restart->fn = futex_wait_restart;
restart->futex.uaddr = (u32 *)uaddr; restart->futex.uaddr = (u32 *)uaddr;
...@@ -1309,13 +1314,11 @@ static int futex_wait(u32 __user *uaddr, int fshared, ...@@ -1309,13 +1314,11 @@ static int futex_wait(u32 __user *uaddr, int fshared,
restart->futex.flags |= FLAGS_SHARED; restart->futex.flags |= FLAGS_SHARED;
if (clockrt) if (clockrt)
restart->futex.flags |= FLAGS_CLOCKRT; restart->futex.flags |= FLAGS_CLOCKRT;
return -ERESTART_RESTARTBLOCK;
}
out_unlock_put_key: ret = -ERESTART_RESTARTBLOCK;
queue_unlock(&q, hb);
put_futex_key(fshared, &q.key);
out_put_key:
put_futex_key(fshared, &q.key);
out: out:
return ret; return ret;
} }
......
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