Skip to content

Commit b8a3045

Browse files
author
Konrad Kusiak
authored
[SYCL] [Graph] Fixed potential dereference of a nullptr (#16392)
We were checking `if (NewEvent != nullptr)` but later we were dereferencing NewEvent without the check. At this point in the code NewEvent should be valid so no assertion is necessary. Fixes #16332
1 parent 258fc72 commit b8a3045

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

sycl/source/detail/graph_impl.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,10 +1011,8 @@ exec_graph_impl::enqueue(const std::shared_ptr<sycl::detail::queue_impl> &Queue,
10111011
// If we have no requirements or dependent events for the command buffer,
10121012
// enqueue it directly
10131013
if (CGData.MRequirements.empty() && CGData.MEvents.empty()) {
1014-
if (NewEvent != nullptr) {
1015-
NewEvent->setSubmissionTime();
1016-
NewEvent->setHostEnqueueTime();
1017-
}
1014+
NewEvent->setSubmissionTime();
1015+
NewEvent->setHostEnqueueTime();
10181016
ur_result_t Res =
10191017
Queue->getAdapter()
10201018
->call_nocheck<

0 commit comments

Comments
 (0)