i2c: npcx: Verify msg is not null
When using target mode, we've found that some times the msg field can be null through some of the code paths of the interrupt event handler. Signed-off-by: Yuval Peress <peress@google.com>
This commit is contained in:
parent
a3728d71e9
commit
c8415cd76b
1 changed files with 1 additions and 1 deletions
|
@ -753,7 +753,7 @@ static void i2c_ctrl_handle_read_int_event(const struct device *dev)
|
|||
}
|
||||
|
||||
/* Is the STOP condition issued? */
|
||||
if ((data->msg->flags & I2C_MSG_STOP) != 0) {
|
||||
if (data->msg != NULL && (data->msg->flags & I2C_MSG_STOP) != 0) {
|
||||
/* Clear rx FIFO threshold and status bits */
|
||||
i2c_ctrl_fifo_clear_status(dev);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue