[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [qemu-upstream-unstable] iov: avoid "orig_len may be used unitialized" warning
commit b314120afdbab3d29885f47fc83bc55f43765968 Author: Michael Tokarev <mjt@xxxxxxxxxx> AuthorDate: Sat Sep 14 13:11:36 2013 +0400 Commit: Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx> CommitDate: Thu Sep 26 20:35:32 2013 -0500 iov: avoid "orig_len may be used unitialized" warning Signed-off-by: Wenchao Xia <xiawenc@xxxxxxxxxxxxxxxxxx> Reviewed-by: Stefan Hajnoczi <stefanha@xxxxxxxxxx> Signed-off-by: Michael Tokarev <mjt@xxxxxxxxxx> (cherry picked from commit 2be178a475289286db80de5ddd7830e67e112bdd) Signed-off-by: Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx> --- util/iov.c | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/util/iov.c b/util/iov.c index f705586..bb46c04 100644 --- a/util/iov.c +++ b/util/iov.c @@ -181,13 +181,11 @@ ssize_t iov_send_recv(int sockfd, struct iovec *iov, unsigned iov_cnt, assert(iov[niov].iov_len > tail); orig_len = iov[niov].iov_len; iov[niov++].iov_len = tail; - } - - ret = do_send_recv(sockfd, iov, niov, do_send); - - /* Undo the changes above before checking for errors */ - if (tail) { + ret = do_send_recv(sockfd, iov, niov, do_send); + /* Undo the changes above before checking for errors */ iov[niov-1].iov_len = orig_len; + } else { + ret = do_send_recv(sockfd, iov, niov, do_send); } if (offset) { iov[0].iov_base -= offset; -- generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |