Merged
Conversation
Only handled ESP-IDF 5.x correctly, but failed for ESP-IDF 4.x because, IDF_VERSION_MAJOR STREQUAL 5 is FALSE for version 4.x, so it fell through to else and could try to use modern driver components
- fix NULL mutex dereference in 3 functions (i2c_setup_port, i2c_dev_delete_mutex, i2c_setup_device) - fix NULL device pointer crashes in 3 wrapper functions (i2c_dev_read_reg, i2c_dev_write_reg, i2c_dev_probe) - fix reference counting asymmetry causing potential premature bus deletion - fix i2cdev_init reinitialization leak with static guard flag - fix CMakeLists.txt ESP-IDF version check for 4.x compatibility
- Remove legacy 'common' submodule - Add eil-cmake-utils submodule for cross-version CMake utilities - Update CMakeLists.txt to use eil_ci module - Required to pass repository structure validation tests
Contributor
Author
|
Added a second commit to migrate from the common submodule to eil-cmake-utils to satisfy the repository structure validation, as in instructions. |
Contributor
|
@quinkq Thank you! |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix critical i2cdev bugs
While creating defensive checks for i2cdev_get_shared_handle, I started thinking about existing code, and added some potential safety.
i2cdev_init()(i2c_setup_port,i2c_dev_delete_mutex,i2c_setup_device)i2c_dev_read_reg,i2c_dev_write_reg,i2c_dev_probe)i2cdev_init()re-initialization leak with static guard flagi2cdev_get_shared_handle()with updated documentation (same as reviewed version in Shared i2c bus handle #6)Code changes are minimal and version-independent. Tested on: ESP-IDF 5.4
CMakeLists.txt changes target 4.x compatibility but untested on 4.x.