mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
Fix theoretical use of uninitialized values
Clang's static analyzer complains about this. In get_configs(), if we have an invalid configuration that has no top level vdevs, we can read a couple of uninitialized variables. Aborting upon seeing this would break the userland tools for healthy pools, so we instead initialize the two variables to 0 to allow the userland tools to continue functioning for the pools with valid configurations. In zfs_do_wait(), if no wait activities are enabled, we read an uninitialized error variable. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu> Closes #14043
This commit is contained in:
committed by
Brian Behlendorf
parent
219cf0f928
commit
4ecd96371b
+1
-1
@@ -8554,7 +8554,7 @@ static int
|
||||
zfs_do_wait(int argc, char **argv)
|
||||
{
|
||||
boolean_t enabled[ZFS_WAIT_NUM_ACTIVITIES];
|
||||
int error, i;
|
||||
int error = 0, i;
|
||||
int c;
|
||||
|
||||
/* By default, wait for all types of activity. */
|
||||
|
||||
Reference in New Issue
Block a user