aboutsummaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
Diffstat (limited to 'ipc')
-rw-r--r--ipc/shm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ipc/shm.c b/ipc/shm.c
index 7efff043ffbf..b5bae9d945b6 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -304,6 +304,9 @@ void exit_shm(struct task_struct *task)
304{ 304{
305 struct ipc_namespace *ns = task->nsproxy->ipc_ns; 305 struct ipc_namespace *ns = task->nsproxy->ipc_ns;
306 306
307 if (shm_ids(ns).in_use == 0)
308 return;
309
307 /* Destroy all already created segments, but not mapped yet */ 310 /* Destroy all already created segments, but not mapped yet */
308 down_write(&shm_ids(ns).rw_mutex); 311 down_write(&shm_ids(ns).rw_mutex);
309 if (shm_ids(ns).in_use) 312 if (shm_ids(ns).in_use)