Skip to content

Commit d18f4b1

Browse files
committed
SWDEV-416218 - Set the image mapped flag correctly on COMGR path.
Change-Id: I6c0908731f10c8ff5b3e159c0cfb68ce096c7bdf
1 parent 4969004 commit d18f4b1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

hipamd/src/hip_fatbin.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,13 @@ hipError_t FatBinaryInfo::ExtractFatBinaryUsingCOMGR(const std::vector<hip::Devi
9494
return hipErrorInvalidValue;
9595

9696
// If image_ is nullptr, then file path is passed via hipMod* APIs, so map the file.
97-
if (image_ == nullptr && !amd::Os::MemoryMapFileDesc(fdesc_, fsize_, foffset_, &image_)
98-
&& (image_mapped_ = true)) {
99-
LogError("Cannot map the file descriptor");
100-
amd::Os::CloseFileHandle(fdesc_);
101-
return hipErrorInvalidValue;
97+
if (image_ == nullptr) {
98+
if(!amd::Os::MemoryMapFileDesc(fdesc_, fsize_, foffset_, &image_)) {
99+
LogError("Cannot map the file descriptor");
100+
amd::Os::CloseFileHandle(fdesc_);
101+
return hipErrorInvalidValue;
102+
}
103+
image_mapped_ = true;
102104
}
103105
}
104106

0 commit comments

Comments
 (0)