[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] nbd: fix uninitialized variable warning

From: pannengyuan
Subject: [PATCH] nbd: fix uninitialized variable warning
Date: Mon, 6 Jan 2020 09:54:43 +0800

From: Pan Nengyuan <address@hidden>

/mnt/sdb/qemu/nbd/server.c: In function 'nbd_handle_request':
/mnt/sdb/qemu/nbd/server.c:2313:9: error: 'ret' may be used uninitialized in 
this function [-Werror=maybe-uninitialized]
     int ret;

Reported-by: Euler Robot <address@hidden>
Signed-off-by: Pan Nengyuan <address@hidden>
 nbd/server.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nbd/server.c b/nbd/server.c
index 24ebc1a805..7eb3de0842 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -2310,7 +2310,7 @@ static coroutine_fn int nbd_handle_request(NBDClient 
                                            NBDRequest *request,
                                            uint8_t *data, Error **errp)
-    int ret;
+    int ret = 0;
     int flags;
     NBDExport *exp = client->exp;
     char *msg;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]