Commit 5e1341d1 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Add SMP barrier to ipc's grow_ary()

From Dipanker Sarma.

Before setting the ids->entries to the new array, there must be a wmb()
to make sure that the memcpyed contents of the new array are visible
before the new array becomes visible.
parent ca22d5dd
......@@ -131,7 +131,13 @@ static int grow_ary(struct ipc_ids* ids, int newsize)
}
old = ids->entries;
i = ids->size;
/*
* before setting the ids->entries to the new array, there must be a
* wmb() to make sure that the memcpyed contents of the new array are
* visible before the new array becomes visible.
*/
wmb();
ids->entries = new;
wmb();
ids->size = newsize;
......
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