From 1c2509dc04122cb339bb69fb2247111f45c03332 Mon Sep 17 00:00:00 2001 From: Lakhan Singh Date: Fri, 20 Apr 2018 17:40:00 +0530 Subject: [PATCH] SWDEV-141024 --- src/hip_memory.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/hip_memory.cpp b/src/hip_memory.cpp index 3073921f50..fbbba027de 100644 --- a/src/hip_memory.cpp +++ b/src/hip_memory.cpp @@ -766,10 +766,18 @@ hipError_t hipArray3DCreate(hipArray_t* array, const HIP_ARRAY_DESCRIPTOR* pAllo hipError_t hipMalloc3DArray(hipArray_t* array, const struct hipChannelFormatDesc* desc, struct hipExtent extent, unsigned int flags) { + + + HIP_INIT_API(array, desc, &extent, flags); HIP_SET_DEVICE(); hipError_t hip_status = hipSuccess; + if(array==NULL ) + { + hip_status=hipErrorInvalidValue; + return ihipLogStatus(hip_status); + } auto ctx = ihipGetTlsDefaultCtx(); *array = (hipArray*)malloc(sizeof(hipArray));