From 1a8476704fa8ec0b4ea3dc02e2d5fe705464cb6a Mon Sep 17 00:00:00 2001 From: foreman Date: Thu, 30 Oct 2014 15:28:52 -0400 Subject: [PATCH] P4 to Git Change 1092343 by gandryey@gera-dev-w7 on 2014/10/30 15:12:30 ECR #304775 - Add a check for NULL dev pointer. - Subbuffer was created, but never used. Thus dev memory could be NULL and lastWriter_ was passed from the parent object on create Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/platform/memory.cpp#112 edit [ROCm/clr commit: 140913a53c996c974dd834e30fe8e7d44c32eafa] --- projects/clr/rocclr/runtime/platform/memory.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/projects/clr/rocclr/runtime/platform/memory.cpp b/projects/clr/rocclr/runtime/platform/memory.cpp index f7d0cee80b..61a13602a5 100644 --- a/projects/clr/rocclr/runtime/platform/memory.cpp +++ b/projects/clr/rocclr/runtime/platform/memory.cpp @@ -459,7 +459,12 @@ Memory::cacheWriteBack() { if (NULL != lastWriter_) { device::Memory* dmem = getDeviceMemory(*lastWriter_); - dmem->syncHostFromCache(); + //! @note It's a special condition, when a subbuffer was created, + //! but never used. Thus dev memory is still NULL and lastWriter_ + //! was passed from the parent. + if (NULL != dmem) { + dmem->syncHostFromCache(); + } } else if (isParent()) { // On CPU parent can't be synchronized, because lastWriter_ could be NULL