qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] fsdev/virtfs-proxy-helper: Fix improper use of negative value
@ 2015-03-16  1:20 Shannon Zhao
  2015-03-16  6:22 ` Aneesh Kumar K.V
  0 siblings, 1 reply; 2+ messages in thread
From: Shannon Zhao @ 2015-03-16  1:20 UTC (permalink / raw)
  To: qemu-devel
  Cc: peter.maydell, hangaohuai, qemu-trivial, mjt, peter.huangpeng,
	aneesh.kumar, pbonzini, shannon.zhao

It's detected by coverity. Check the return value of proxy_marshal.

Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
---
 fsdev/virtfs-proxy-helper.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c
index c1da2d7..bf2e5f3 100644
--- a/fsdev/virtfs-proxy-helper.c
+++ b/fsdev/virtfs-proxy-helper.c
@@ -262,6 +262,9 @@ static int send_status(int sockfd, struct iovec *iovec, int status)
      */
     msg_size = proxy_marshal(iovec, 0, "ddd", header.type,
                              header.size, status);
+    if (msg_size < 0) {
+        return msg_size;
+    }
     retval = socket_write(sockfd, iovec->iov_base, msg_size);
     if (retval < 0) {
         return retval;
-- 
1.8.3.1

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

end of thread, other threads:[~2015-03-16  6:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-16  1:20 [Qemu-devel] [PATCH] fsdev/virtfs-proxy-helper: Fix improper use of negative value Shannon Zhao
2015-03-16  6:22 ` Aneesh Kumar K.V

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).