ivshmem: fix race condition
authorMauricio Vasquez B <mauricio.vasquezbernal@studenti.polito.it>
Fri, 1 Apr 2016 11:22:12 +0000 (13:22 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Fri, 1 Apr 2016 13:36:32 +0000 (15:36 +0200)
commit1e7d0509fe43b340f9a0e2f90b734825c6c2034b
treebfc505b1960794f9f14228b54ac79602d096073d
parentaea2af182c15fd0564a1a75bcafeddac4ebb8418
ivshmem: fix race condition

The memory zone could be freed just after adding it to the metadata
file and just before marking it as not freeable.
This patch changes the locking logic in order to prevent it.

Fixes: cd10c42eb5bc ("mem: fix ivshmem freeing")

Signed-off-by: Mauricio Vasquez B <mauricio.vasquezbernal@studenti.polito.it>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
lib/librte_ivshmem/rte_ivshmem.c