mirror of
https://github.com/drasko/codezero.git
synced 2026-03-02 18:43:16 +01:00
Added the forgotten freeing of shm id when destroying shm area.
This commit is contained in:
@@ -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);
|
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 &&
|
if ((unsigned long)shm_desc->shm_addr >= UTCB_AREA_START &&
|
||||||
(unsigned long)shm_desc->shm_addr < UTCB_AREA_END)
|
(unsigned long)shm_desc->shm_addr < UTCB_AREA_END)
|
||||||
utcb_delete_address(shm_desc->shm_addr);
|
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);
|
shm_file->vm_obj.npages);
|
||||||
else
|
else
|
||||||
BUG();
|
BUG();
|
||||||
|
|
||||||
|
/* Release the shared memory id */
|
||||||
|
BUG_ON(id_del(shm_ids, shm_desc->shmid) < 0);
|
||||||
|
|
||||||
/* Now delete the private data itself */
|
/* Now delete the private data itself */
|
||||||
kfree(shm_file->priv_data);
|
kfree(shm_file->priv_data);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user