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

Change-Id: Iad99f996dcf90ffb86f62e79bf4cbd53b35b7e3b
このコミットが含まれているのは:
Sourabh Betigeri
2020-10-13 01:19:47 -07:00
committed by Sourabh Betigeri
コミット b65314d168
4個のファイルの変更23行の追加4行の削除
+5 -1
ファイルの表示
@@ -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());