Skip to content

Commit ba69c58

Browse files
authored
[SYCL] Check pointer to event before dereferencing (#2263)
Signed-off-by: Artur Gainullin <[email protected]>
1 parent 88cbe10 commit ba69c58

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sycl/plugins/level_zero/pi_level_zero.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3123,7 +3123,8 @@ pi_result piEnqueueMemUnmap(pi_queue Queue, pi_mem MemObj, void *MappedPtr,
31233123
// piEnqueueMemBufferMap, but can only do so after the above copy
31243124
// is completed. Instead of waiting for It here (blocking), we shall
31253125
// do so in piEventRelease called for the pi_event tracking the unmap.
3126-
(*Event)->CommandData = MemObj->MapHostPtr ? nullptr : MappedPtr;
3126+
if (Event)
3127+
(*Event)->CommandData = MemObj->MapHostPtr ? nullptr : MappedPtr;
31273128

31283129
// Execute command list asynchronously, as the event will be used
31293130
// to track down its completion.

0 commit comments

Comments
 (0)