From: Masatake YAMATO Date: Wed, 8 Dec 2021 05:55:06 +0000 (+0900) Subject: lsfd: declare local variables at the beginning of block X-Git-Tag: v2.38-rc1~96^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3401af7c45890792f090c3a4579f4b13fc7720c1;p=thirdparty%2Futil-linux.git lsfd: declare local variables at the beginning of block Signed-off-by: Masatake YAMATO --- diff --git a/misc-utils/lsfd-bdev.c b/misc-utils/lsfd-bdev.c index 442e2ee8c6..b2fecdc8dc 100644 --- a/misc-utils/lsfd-bdev.c +++ b/misc-utils/lsfd-bdev.c @@ -126,9 +126,11 @@ static void read_partitions(struct list_head *partitions_list, FILE *part_fp) static void bdev_class_initialize(void) { + FILE *part_fp; + INIT_LIST_HEAD(&partitions); - FILE *part_fp = fopen("/proc/partitions", "r"); + part_fp = fopen("/proc/partitions", "r"); if (part_fp) { read_partitions(&partitions, part_fp); fclose(part_fp);