Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release_2.5: dm: rb: only free rb_entry when we remove this entry from the rb tree #6058

Merged
merged 1 commit into from May 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
dm: rb: only free rb_entry when we remove this entry from the rb tree
Only free rb_entry when we remove this entry from the rb tree, otherwise, a
page fault would trigger when next rb itreation would access the freed rb_entry.

Tracked-On: #6056
Signed-off-by: Li Fei1 <fei1.li@intel.com>
  • Loading branch information
lifeix committed May 24, 2021
commit f880086ffe5423e67d968c8f8f665954786582ce
6 changes: 3 additions & 3 deletions devicemodel/core/mem.c
Expand Up @@ -248,13 +248,13 @@ unregister_mem_int(struct mmio_rb_tree *rbt, struct mem_range *memp)
/* flush Per-VM cache */
if (mmio_hint == entry)
mmio_hint = NULL;

if (entry)
free(entry);
}
}
pthread_rwlock_unlock(&mmio_rwlock);

if (entry)
free(entry);

return err;
}

Expand Down