fsdev/virtfs-proxy-helper: Fix improper use of negative value
authorShannon Zhao <zhaoshenglong@huawei.com>
Mon, 16 Mar 2015 01:20:29 +0000 (09:20 +0800)
committerAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Mon, 16 Mar 2015 06:20:07 +0000 (11:50 +0530)
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>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
fsdev/virtfs-proxy-helper.c

index c1da2d78e78b711260856c72909184b4d6809324..bf2e5f33312160172942e3e44106251a74692777 100644 (file)
@@ -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;