Added the forgotten freeing of shm id when destroying shm area.

This commit is contained in:
Bahadir Balban
2008-10-22 15:39:18 +03:00
parent 1ee5cc9c2b
commit 299549ec4a

View File

@@ -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);
}