mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-16 16:14:25 -04:00
kern: fix resource leak bugs
This commit is contained in:
parent
11d5353827
commit
46935fea80
4 changed files with 7 additions and 2 deletions
|
@ -75,6 +75,9 @@ namespace ams::kern {
|
|||
KPageGroup pg(page_table->GetBlockInfoManager());
|
||||
R_TRY(page_table->LockForDeviceAddressSpace(std::addressof(pg), process_address, size, ConvertToKMemoryPermission(device_perm), is_aligned));
|
||||
|
||||
/* Close the pages we opened when we're done with them. */
|
||||
ON_SCOPE_EXIT { pg.Close(); };
|
||||
|
||||
/* Ensure that if we fail, we don't keep unmapped pages locked. */
|
||||
ON_SCOPE_EXIT {
|
||||
if (*out_mapped_size != size) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue