Browse Source

fsdev/virtfs-proxy-helper: Fix improper use of negative value

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>
Shannon Zhao 10 năm trước cách đây
mục cha
commit
821c447675
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      fsdev/virtfs-proxy-helper.c

+ 3 - 0
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;