Skip to content

Commit 82cddff

Browse files
sherry-yuanpcolberg
authored andcommitted
Check pointer 'op' for NULL before dereferencing
--------------------------------------------------------------------------- 181 (Local) src/acl_device_op.cpp:464 RNPD.DEREF (1:Critical) Analyze Suspicious dereference of pointer 'op' before NULL check at line 467 * acl_device_op.cpp:464: 'op' is dereferenced. * acl_device_op.cpp:467: 'op' is checked for NULL. Current status 'Analyze' Summary: 1 Local 1 Total Issue(s)
1 parent 8b8ed35 commit 82cddff

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/acl_device_op.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,8 @@ static unsigned
461461
l_get_devices_affected_for_op(acl_device_op_t *op, unsigned int physical_ids[],
462462
acl_device_op_conflict_type_t conflicts[]) {
463463
unsigned int num_devices_affected = 0;
464+
// The precondition of the function is device op must be active
465+
assert(op);
464466
cl_event event = op->info.event;
465467
acl_assert_locked();
466468

0 commit comments

Comments
 (0)