Skip to content

Commit

Permalink
Fix Coverity dereference before null check issue (intel#13456)
Browse files Browse the repository at this point in the history
Fixes an issue found by Coverity in `addEventForNode` about
dereferencing the `EventImpl` before a null check.

---------

Co-authored-by: Ben Tracy <ben.tracy@codeplay.com>
  • Loading branch information
julianmi and Bensuo authored Apr 17, 2024
1 parent a073a6a commit c02f915
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sycl/source/detail/graph_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ class graph_impl {
void addEventForNode(std::shared_ptr<graph_impl> GraphImpl,
std::shared_ptr<sycl::detail::event_impl> EventImpl,
std::shared_ptr<node_impl> NodeImpl) {
if (!(EventImpl->getCommandGraph()))
if (EventImpl && !(EventImpl->getCommandGraph()))
EventImpl->setCommandGraph(GraphImpl);
MEventsMap[EventImpl] = NodeImpl;
}
Expand Down

0 comments on commit c02f915

Please sign in to comment.