From 70248b82e8229c00531c1618814ca5fa9bc82a98 Mon Sep 17 00:00:00 2001 From: Richard Yao Date: Tue, 11 Oct 2022 15:24:36 -0400 Subject: [PATCH] Fix uninitialized value read in vdev_prop_set() If no errors are encountered, we read an uninitialized error value. Clang's static analyzer complained about this. Reviewed-by: Tino Reichardt Reviewed-by: Ryan Moeller Reviewed-by: Brian Behlendorf Signed-off-by: Richard Yao Closes #14007 --- module/zfs/vdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/zfs/vdev.c b/module/zfs/vdev.c index 66cec052b..52265d960 100644 --- a/module/zfs/vdev.c +++ b/module/zfs/vdev.c @@ -5648,7 +5648,7 @@ vdev_prop_set(vdev_t *vd, nvlist_t *innvl, nvlist_t *outnvl) nvpair_t *elem = NULL; uint64_t vdev_guid; nvlist_t *nvprops; - int error; + int error = 0; ASSERT(vd != NULL);