提交 ff541598 创建 作者: Nickolai Zeldovich's avatar Nickolai Zeldovich

needless alloc/free

上级 84cb1375
......@@ -426,17 +426,15 @@ vmap_copy(struct vmap *m, int share)
return 0;
acquire(&m->lock);
struct state *st = kmalloc(sizeof(struct state));
st->share = share;
st->pml4 = m->pml4;
st->cr = c->cr;
if (!crange_foreach(m->cr, vmap_copy_vma, st)) {
struct state st;
st.share = share;
st.pml4 = m->pml4;
st.cr = c->cr;
if (!crange_foreach(m->cr, vmap_copy_vma, &st)) {
vmap_free(c);
release(&m->lock);
kmfree(st);
return 0;
}
kmfree(st);
if (share)
lcr3(v2p(m->pml4)); // Reload hardware page table
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论