37 lines
1.3 KiB
Diff
37 lines
1.3 KiB
Diff
|
|
From 2edda423f2bca2348595e99a4ef9f5c73e262e77 Mon Sep 17 00:00:00 2001
|
|||
|
|
From: qihao_yewu <qihao_yewu@cmss.chinamobile.com>
|
|||
|
|
Date: Wed, 9 Oct 2024 07:25:22 -0400
|
|||
|
|
Subject: [PATCH] block: fix -Werror=maybe-uninitialized false-positive
|
|||
|
|
MIME-Version: 1.0
|
|||
|
|
Content-Type: text/plain; charset=UTF-8
|
|||
|
|
Content-Transfer-Encoding: 8bit
|
|||
|
|
|
|||
|
|
cheery-pick from eb5d28c783078ad2d7fb42349e146190cd98678b
|
|||
|
|
|
|||
|
|
../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 <marcandre.lureau@redhat.com>
|
|||
|
|
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
|
|||
|
|
Signed-off-by: qihao_yewu <qihao_yewu@cmss.chinamobile.com>
|
|||
|
|
---
|
|||
|
|
block/file-posix.c | 2 +-
|
|||
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|||
|
|
|
|||
|
|
diff --git a/block/file-posix.c b/block/file-posix.c
|
|||
|
|
index 4ac8f684f1..787f613d52 100644
|
|||
|
|
--- a/block/file-posix.c
|
|||
|
|
+++ b/block/file-posix.c
|
|||
|
|
@@ -1423,7 +1423,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);
|
|||
|
|
--
|
|||
|
|
2.41.0.windows.1
|
|||
|
|
|