Skip to content

Commit 75e921d

Browse files
authored
kstat: silence "maybe uninitialized" warnings
Firmly in the "shouldn't happen" camp, but at least GCC 7.4 (Ubuntu 18.04) complained about them, and it's easy to shut up, so do so. Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: Rob Norris <[email protected]> Closes #17189
1 parent 5b29e70 commit 75e921d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

module/os/linux/spl/spl-kstat.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ kstat_delete_module(kstat_module_t *module)
395395

396396
kstat_module_t *parent = module->ksm_parent;
397397

398-
char *p = module->ksm_name, *frag;
398+
char *p = module->ksm_name, *frag = NULL;
399399
while (p != NULL && (frag = strsep(&p, "/"))) {}
400400

401401
remove_proc_entry(frag, parent ? parent->ksm_proc : proc_spl_kstat);
@@ -420,7 +420,7 @@ kstat_create_module(char *name)
420420

421421
(void) strlcpy(buf, name, KSTAT_STRLEN);
422422

423-
parent = NULL;
423+
module = parent = NULL;
424424
char *p = buf, *frag;
425425
while ((frag = strsep(&p, "/")) != NULL) {
426426
module = kstat_find_module(buf);
@@ -454,7 +454,6 @@ kstat_create_module(char *name)
454454
}
455455

456456
return (module);
457-
458457
}
459458

460459
static int

0 commit comments

Comments
 (0)