qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nbd: fix uninitialized variable warning
@ 2020-01-06  1:54 pannengyuan
  2020-01-07 22:24 ` Eric Blake
  0 siblings, 1 reply; 3+ messages in thread
From: pannengyuan @ 2020-01-06  1:54 UTC (permalink / raw)
  To: eblake
  Cc: zhang.zhanghailiang, qemu-block, qemu-trivial, Pan Nengyuan,
	qemu-devel, Euler Robot

From: Pan Nengyuan <pannengyuan@huawei.com>

Fixes:
/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 <euler.robot@huawei.com>
Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com>
---
 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 *client,
                                            NBDRequest *request,
                                            uint8_t *data, Error **errp)
 {
-    int ret;
+    int ret = 0;
     int flags;
     NBDExport *exp = client->exp;
     char *msg;
-- 
2.21.0.windows.1




^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-08  2:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-06  1:54 [PATCH] nbd: fix uninitialized variable warning pannengyuan
2020-01-07 22:24 ` Eric Blake
2020-01-08  2:05   ` Pan Nengyuan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).