]> sourceware.org Git - lvm2.git/commitdiff
gcc: fix warning about uninitialized use 1523580926
authorZdenek Kabelac <zkabelac@redhat.com>
Fri, 1 Nov 2024 14:20:50 +0000 (15:20 +0100)
committerZdenek Kabelac <zkabelac@redhat.com>
Fri, 1 Nov 2024 16:48:28 +0000 (17:48 +0100)
get_sizes_lockspace() may not always initilize all passed values
in case the bitfield would not trigger if() path.
So just in case keep the path initilized.

TODO: maybe add INTERNAL_ERROR to get_sizes_lockspace().

daemons/lvmlockd/lvmlockd-sanlock.c

index e97b0035d32f6dd3dc8c8edb414ca4433a12a7f5..857798e6967ee247dfc4e56357c4fb2c58f66911 100644 (file)
@@ -782,11 +782,11 @@ int lm_init_lv_sanlock(struct lockspace *ls, char *ls_name, char *vg_name, char
        char lock_args_version[MAX_VERSION+1];
        uint64_t offset;
        uint64_t prev_offset = 0;
-       int sector_size;
-       int align_size;
+       int sector_size = 0;
+       int align_size = 0;
        int align_mb;
        uint32_t ss_flags;
-       uint32_t rs_flags;
+       uint32_t rs_flags = 0;
        uint32_t tries = 1;
        int rv;
 
This page took 0.035338 seconds and 5 git commands to generate.