Skip to content

Commit

Permalink
Kernel: Remove some more harmless InodeVMObject miscasts
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed Mar 1, 2020
1 parent b614462 commit fee20bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Kernel/Process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ int Process::sys$mprotect(void* addr, size_t size, int prot)
if (whole_region->access() == prot_to_region_access_flags(prot))
return 0;
if (whole_region->vmobject().is_inode()
&& !validate_inode_mmap_prot(*this, prot, static_cast<const SharedInodeVMObject&>(whole_region->vmobject()).inode(), whole_region->is_shared())) {
&& !validate_inode_mmap_prot(*this, prot, static_cast<const InodeVMObject&>(whole_region->vmobject()).inode(), whole_region->is_shared())) {
return -EACCES;
}
whole_region->set_readable(prot & PROT_READ);
Expand All @@ -560,7 +560,7 @@ int Process::sys$mprotect(void* addr, size_t size, int prot)
if (old_region->access() == prot_to_region_access_flags(prot))
return 0;
if (old_region->vmobject().is_inode()
&& !validate_inode_mmap_prot(*this, prot, static_cast<const SharedInodeVMObject&>(old_region->vmobject()).inode(), old_region->is_shared())) {
&& !validate_inode_mmap_prot(*this, prot, static_cast<const InodeVMObject&>(old_region->vmobject()).inode(), old_region->is_shared())) {
return -EACCES;
}

Expand Down
2 changes: 1 addition & 1 deletion Kernel/VM/Region.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ size_t Region::amount_dirty() const
{
if (!vmobject().is_inode())
return amount_resident();
return static_cast<const SharedInodeVMObject&>(vmobject()).amount_dirty();
return static_cast<const InodeVMObject&>(vmobject()).amount_dirty();
}

size_t Region::amount_resident() const
Expand Down

0 comments on commit fee20bd

Please sign in to comment.