HomeFreeBSD

Silence static analyzer warnings about spa_sync_props()

Description

Silence static analyzer warnings about spa_sync_props()

Both Coverity and Clang's static analyzer complain about reading an
uninitialized intval if the property is not passed as DATA_TYPE_UINT64
in the nvlist. This is impossible becuase spa_prop_validate() already
checked this, but they are unlikely to be the last static analyzers to
complain about this, so lets just refactor the code to suppress the
warnings.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #14043

Details

Provenance
Richard Yao <richard.yao@alumni.stonybrook.edu>Authored on Oct 15 2022, 10:34 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Oct 20 2022, 12:10 AM
Parents
rG4ecd96371bcd: Fix theoretical use of uninitialized values
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG44f71818f82c: Silence static analyzer warnings about spa_sync_props() (authored by Richard Yao <richard.yao@alumni.stonybrook.edu>).Oct 20 2022, 12:10 AM