1.1 --- a/libfsclient/lib/src/file.cc Mon Oct 24 01:15:30 2022 +0200
1.2 +++ b/libfsclient/lib/src/file.cc Thu Oct 27 01:06:33 2022 +0200
1.3 @@ -356,16 +356,17 @@
1.4 offset_t start_visible, offset_t end_visible,
1.5 l4re_rm_flags_t region_flags)
1.6 {
1.7 + if (file->memory != NULL)
1.8 + {
1.9 + ipc_detach_dataspace(file->memory);
1.10 + file->memory = NULL;
1.11 + }
1.12 +
1.13 long err = file_mmap_only(file, position, length, start_visible, end_visible);
1.14
1.15 if (err)
1.16 return err;
1.17
1.18 - if (file->memory != NULL)
1.19 - ipc_detach_dataspace(file->memory);
1.20 -
1.21 - file->memory = NULL;
1.22 -
1.23 err = ipc_attach_dataspace_align(file->ref, file_span(file),
1.24 L4RE_RM_F_SEARCH_ADDR | region_flags,
1.25 L4_PAGESHIFT,