SWDEV-251091: Added null checks and empty file check in hip_module and hip_platform

Change-Id: Iad99f996dcf90ffb86f62e79bf4cbd53b35b7e3b


[ROCm/clr commit: b65314d168]
This commit is contained in:
Sourabh Betigeri authored and Sourabh Betigeri committed 2020-10-20 19:55:01 -04:00
1 orang tua e37d37fb26
melakukan 19f45f83f3
4 files changed
+23 -4

No files matched your search

@@ -11,7 +11,7 @@
namespace hip {
uint64_t CodeObject::ElfSize(const void *emi) {
return amd::Elf::getElfSize(emi);
return amd::Elf::getElfSize(emi);
}
bool CodeObject::isCompatibleCodeObject(const std::string& codeobj_target_id,
@@ -180,6 +180,10 @@ hipError_t DynCO::getDynFunc(hipFunction_t* hfunc, std::string func_name) {
CheckDeviceIdMatch();
if(hfunc == nullptr) {
return hipErrorInvalidValue;
}
auto it = functions_.find(func_name);
if (it == functions_.end()) {
DevLogPrintfError("Cannot find the function: %s ", func_name.c_str());