kern: fix resource leak bugs

This commit is contained in:
Michael Scire authored and SciresM committed 2020-07-31 14:50:52 -07:00
1 parent 11d5353827
commit 46935fea80
4 files changed
+7 -2

No files matched your search

@@ -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) {