You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The I2C DW target driver does not properly check the return values of callback functions as defined in the I2C target API. Specifically, the functions i2c_target_write_requested_cb_t, i2c_target_write_received_cb_t, i2c_target_read_requested_cb_t, and i2c_target_read_processed_cb_t are being invoked without proper error handling of their return values, which may result in unexpected behavior.
To Reproduce
The problem can be observed in the source code.
Expected behavior
The driver should check the return values of all callback functions and respond appropriately, such as NACKing or stopping the transfer when an error is returned.
Impact
This issue could lead to silent failures in I2C communication, making it difficult to debug I2C-related problems. It may cause data corruption or communication deadlocks in systems relying on proper I2C target behavior.
Logs and console output
N/A for this issue, as it's a code-level problem rather than a runtime error.
Environment (please complete the following information):
OS: Various (issue is in the Zephyr RTOS code)
Toolchain: Various
Commit SHA or Version used: Latest main branch as of reporting date
Hi @teburd, I am looking for something a bug to fix for my first issue :) Just wondering if you have made any progress on fixing this bug or can I take a crack at it? Thanks very much!
Hi @teburd, I am looking for something a bug to fix for my first issue :) Just wondering if you have made any progress on fixing this bug or can I take a crack at it? Thanks very much!
Please take a crack at it if, particularly if you have a nice way of testing!
Describe the bug
The I2C DW target driver does not properly check the return values of callback functions as defined in the I2C target API. Specifically, the functions
i2c_target_write_requested_cb_t
,i2c_target_write_received_cb_t
,i2c_target_read_requested_cb_t
, andi2c_target_read_processed_cb_t
are being invoked without proper error handling of their return values, which may result in unexpected behavior.To Reproduce
The problem can be observed in the source code.
Expected behavior
The driver should check the return values of all callback functions and respond appropriately, such as NACKing or stopping the transfer when an error is returned.
Impact
This issue could lead to silent failures in I2C communication, making it difficult to debug I2C-related problems. It may cause data corruption or communication deadlocks in systems relying on proper I2C target behavior.
Logs and console output
N/A for this issue, as it's a code-level problem rather than a runtime error.
Environment (please complete the following information):
Additional context
Here's the problematic code:
The text was updated successfully, but these errors were encountered: