Skip to content
Commit 7d5902dd authored by Gaetan Perrot's avatar Gaetan Perrot Committed by Daniel DeGrasse
Browse files

drivers: akm09918c: fix null dereference in submit function



Fix a null pointer dereference in akm09918c_submit(), where writeByte_sqe
was dereferenced before checking if it was NULL.

Coverity reported this as CID 516247: the pointer returned by
i2c_rtio_copy_reg_write_byte() may be NULL, and accessing its `flags`
field before checking leads to undefined behavior.

Move the access to writeByte_sqe->flags after confirming both
writeByte_sqe and cb_sqe are valid.

Fixes: CID 516247

Signed-off-by: default avatarGaetan Perrot <gaetan.perrot@spacecubics.com>
parent 9eaed805
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment