-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
A couple of coverity fixes #13064
A couple of coverity fixes #13064
Conversation
This might fix a warning about argv being a TAINTED_SCALAR further down.
|
||
select_airspeed_and_publish(); | ||
select_airspeed_and_publish(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
select_airspeed_and_publish() should also be executed if no airspeed sensor is connected, so with this change I think it wouldn't work.
Inside select_airspeed_and_publish, _airspeed_validator is used yes, but only if the number of airspeed sensors is >0, in which case _airspeed_validator is != nullptr. Probably not the nicest way to program it, but should be safe, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha. However, there is still one catch: if new
fails to allocate because you're out of RAM _airspeed_validator
is also null even though _number_of_airspeed_sensors
is > 0
. We need some kind of mechanism to check for that failure case and notify that airspeed is broken and we must not fly.
Yes, I'll do that. @julianoes you can remove the 4 commits concerning the airspeed selector, I'll handle it in #12887. |
@sfuhrer you can change this branch and do interactive rebase as you want. |
9a3aa7b
to
59e611f
Compare
Done. This PR is then ready to be merged I'd say. |
Thanks @sfuhrer! |
Coverity sends me these emails about potential problems. In order to get to inbox-zero I had to attempt to fix some of them.