From: Marc-André Lureau Date: Tue, 24 Sep 2024 12:45:48 +0000 (+0400) Subject: block: fix -Werror=maybe-uninitialized false-positive X-Git-Tag: v9.2.0-rc0~64^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eb5d28c783078ad2d7fb42349e146190cd98678b;p=thirdparty%2Fqemu.git block: fix -Werror=maybe-uninitialized false-positive ../block/file-posix.c:1405:17: error: ‘zoned’ may be used uninitialized [-Werror=maybe-uninitialized] 1405 | if (ret < 0 || zoned == BLK_Z_NONE) { Signed-off-by: Marc-André Lureau Reviewed-by: Vladimir Sementsov-Ogievskiy --- diff --git a/block/file-posix.c b/block/file-posix.c index ff928b5e858..90fa54352c2 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -1398,7 +1398,7 @@ static void raw_refresh_zoned_limits(BlockDriverState *bs, struct stat *st, Error **errp) { BDRVRawState *s = bs->opaque; - BlockZoneModel zoned; + BlockZoneModel zoned = BLK_Z_NONE; int ret; ret = get_sysfs_zoned_model(st, &zoned);