Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: w1: fix return check in bit_read and bus_reset for w1-gpio #68587

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

str4t0m
Copy link
Collaborator

@str4t0m str4t0m commented Feb 6, 2024

The driver masked the return value of a pin read operation before checking the error.
Thus not detecting a potential error and leading to logically dead code, which was detected by coverity in CID 340853. Anther instance XORs 1 before returning, resulting in an unexpected return value

Fixes #67945

The driver masked the return value of a pin read operation before
checking the error.
Thus not detecting a potential error and leading to logically
dead code, which was detected by coverity in CID 340853.
Anther instance XORs 1 before returning, resulting in an unexpected
return value;

Signed-off-by: Thomas Stranger <[email protected]>
@str4t0m str4t0m marked this pull request as ready for review February 6, 2024 11:54
@zephyrbot zephyrbot added the area: W1 1-Wire label Feb 6, 2024
@MaureenHelm MaureenHelm added bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix labels Feb 6, 2024
@MaureenHelm MaureenHelm added this to the v3.6.0 milestone Feb 6, 2024
@fabiobaltieri fabiobaltieri merged commit 505cc19 into zephyrproject-rtos:main Feb 8, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: W1 1-Wire bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Coverity CID: 340853] Logically dead code in drivers/w1/w1_zephyr_gpio.c
6 participants