From de5f47a98410e08761199be33134fc012e208353 Mon Sep 17 00:00:00 2001 From: Qianfeng Zhang Date: Tue, 23 Oct 2018 21:13:11 +0800 Subject: [PATCH] Make correct checking of the returned hipDeviceptr_t from read_global_description() --- src/hip_module.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hip_module.cpp b/src/hip_module.cpp index a6d486b6de..bb419740e3 100644 --- a/src/hip_module.cpp +++ b/src/hip_module.cpp @@ -342,7 +342,7 @@ hipError_t read_agent_global_from_module(hipDeviceptr_t* dptr, size_t* bytes, hi tie(*dptr, *bytes) = read_global_description(it0->second.cbegin(), it0->second.cend(), name); - return dptr ? hipSuccess : hipErrorNotFound; + return *dptr ? hipSuccess : hipErrorNotFound; } hipError_t read_agent_global_from_process(hipDeviceptr_t* dptr, size_t* bytes, const char* name) { @@ -367,7 +367,7 @@ hipError_t read_agent_global_from_process(hipDeviceptr_t* dptr, size_t* bytes, c tie(*dptr, *bytes) = read_global_description(it->second.cbegin(), it->second.cend(), name); - return dptr ? hipSuccess : hipErrorNotFound; + return *dptr ? hipSuccess : hipErrorNotFound; } hsa_executable_symbol_t find_kernel_by_name(hsa_executable_t executable, const char* kname) {