From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55576) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXORI-00046C-67 for qemu-devel@nongnu.org; Mon, 16 Mar 2015 02:23:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXORC-0001AW-5m for qemu-devel@nongnu.org; Mon, 16 Mar 2015 02:23:48 -0400 Received: from e23smtp02.au.ibm.com ([202.81.31.144]:33037) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXORB-0001AD-Gk for qemu-devel@nongnu.org; Mon, 16 Mar 2015 02:23:42 -0400 Received: from /spool/local by e23smtp02.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 16 Mar 2015 16:23:37 +1000 From: "Aneesh Kumar K.V" In-Reply-To: <1426468829-8024-1-git-send-email-zhaoshenglong@huawei.com> References: <1426468829-8024-1-git-send-email-zhaoshenglong@huawei.com> Date: Mon, 16 Mar 2015 11:52:41 +0530 Message-ID: <87mw3dmpfy.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] fsdev/virtfs-proxy-helper: Fix improper use of negative value List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Shannon Zhao , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, hangaohuai@huawei.com, qemu-trivial@nongnu.org, mjt@tls.msk.ru, peter.huangpeng@huawei.com, shannon.zhao@linaro.org, pbonzini@redhat.com Shannon Zhao writes: > It's detected by coverity. Check the return value of proxy_marshal. > > Signed-off-by: Shannon Zhao > Signed-off-by: Shannon Zhao Applied > --- > 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