qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH v4 12/14] contrib/ivshmem-*: various fixes


From: David Marchand
Subject: [Qemu-devel] [PATCH v4 12/14] contrib/ivshmem-*: various fixes
Date: Tue, 2 Sep 2014 17:25:30 +0200

More fixes following Gonglei comments:
- add a missing \n in a debug message.
- add an explicit initialisation of sock_fd.
- fix a check on vector index.

Signed-off-by: David Marchand <address@hidden>
---
 contrib/ivshmem-client/ivshmem-client.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/contrib/ivshmem-client/ivshmem-client.c 
b/contrib/ivshmem-client/ivshmem-client.c
index e9a19ff..ad210c8 100644
--- a/contrib/ivshmem-client/ivshmem-client.c
+++ b/contrib/ivshmem-client/ivshmem-client.c
@@ -105,7 +105,7 @@ handle_server_msg(IvshmemClient *client)
     if (fd == -1) {
 
         if (peer == NULL || peer == &client->local) {
-            debug_log(client, "receive delete for invalid peer %ld", peer_id);
+            debug_log(client, "receive delete for invalid peer %ld\n", 
peer_id);
             return -1;
         }
 
@@ -155,6 +155,7 @@ ivshmem_client_init(IvshmemClient *client, const char 
*unix_sock_path,
     client->notif_cb = notif_cb;
     client->notif_arg = notif_arg;
     client->verbose = verbose;
+    client->sock_fd = -1;
 
     return 0;
 }
@@ -309,7 +310,7 @@ ivshmem_client_notify(const IvshmemClient *client,
     uint64_t kick;
     int fd;
 
-    if (vector > peer->vectors_count) {
+    if (vector >= peer->vectors_count) {
         debug_log(client, "invalid vector %u on peer %ld\n", vector, peer->id);
         return -1;
     }
-- 
1.7.10.4




reply via email to

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