Commit 3a0671d2 authored by Jeremy Soller's avatar Jeremy Soller

Fix dropping grants without unmapping if they have no file descriptor (such as...

Fix dropping grants without unmapping if they have no file descriptor (such as those from anonymous maps)
parent 339d68ac
......@@ -427,11 +427,9 @@ pub fn funmap(virtual_address: usize) -> Result<usize> {
let end = start + grants[i].size();
if virtual_address >= start && virtual_address < end {
let mut grant = grants.remove(i);
if grant.desc_opt.is_some() {
desc_opt = grant.desc_opt.take();
grant.unmap();
break;
}
desc_opt = grant.desc_opt.take();
grant.unmap();
break;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment