From 299549ec4ae635be31267ca76316de8270ae7eb3 Mon Sep 17 00:00:00 2001 From: Bahadir Balban Date: Wed, 22 Oct 2008 15:39:18 +0300 Subject: [PATCH] Added the forgotten freeing of shm id when destroying shm area. --- tasks/mm0/src/shm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tasks/mm0/src/shm.c b/tasks/mm0/src/shm.c index bb79b3a..10e8863 100644 --- a/tasks/mm0/src/shm.c +++ b/tasks/mm0/src/shm.c @@ -180,6 +180,7 @@ void shm_destroy_priv_data(struct vm_file *shm_file) { struct shm_descriptor *shm_desc = shm_file_to_desc(shm_file); + /* Release the shared memory address */ if ((unsigned long)shm_desc->shm_addr >= UTCB_AREA_START && (unsigned long)shm_desc->shm_addr < UTCB_AREA_END) utcb_delete_address(shm_desc->shm_addr); @@ -189,6 +190,10 @@ void shm_destroy_priv_data(struct vm_file *shm_file) shm_file->vm_obj.npages); else BUG(); + + /* Release the shared memory id */ + BUG_ON(id_del(shm_ids, shm_desc->shmid) < 0); + /* Now delete the private data itself */ kfree(shm_file->priv_data); }