From 36a85741defe2ff01afaf0d39841c95ae77f65d4 Mon Sep 17 00:00:00 2001 From: Ajay Date: Tue, 5 Jul 2022 18:41:08 +0000 Subject: [PATCH] SWDEV-344440 SWDEV-344433 - null ptr checks for hipMemPoolGetAttribute hipMemPoolSetAttribute Change-Id: I812abb3c74a05c4ec9097b09ee7e9a86b0c91e9b --- hipamd/src/hip_mempool.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hipamd/src/hip_mempool.cpp b/hipamd/src/hip_mempool.cpp index 960845f1e0..cc7ba10865 100644 --- a/hipamd/src/hip_mempool.cpp +++ b/hipamd/src/hip_mempool.cpp @@ -102,7 +102,7 @@ hipError_t hipMemPoolTrimTo(hipMemPool_t mem_pool, size_t min_bytes_to_hold) { // ================================================================================================ hipError_t hipMemPoolSetAttribute(hipMemPool_t mem_pool, hipMemPoolAttr attr, void* value) { HIP_INIT_API(hipMemPoolSetAttribute, mem_pool, attr, value); - if (mem_pool == nullptr) { + if (mem_pool == nullptr || value == nullptr) { HIP_RETURN(hipErrorInvalidValue); } auto hip_mem_pool = reinterpret_cast(mem_pool); @@ -112,7 +112,7 @@ hipError_t hipMemPoolSetAttribute(hipMemPool_t mem_pool, hipMemPoolAttr attr, vo // ================================================================================================ hipError_t hipMemPoolGetAttribute(hipMemPool_t mem_pool, hipMemPoolAttr attr, void* value) { HIP_INIT_API(hipMemPoolGetAttribute, mem_pool, attr, value); - if (mem_pool == nullptr) { + if (mem_pool == nullptr || value == nullptr) { HIP_RETURN(hipErrorInvalidValue); } auto hip_mem_pool = reinterpret_cast(mem_pool);