From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPUXX-0006uQ-57 for qemu-devel@nongnu.org; Tue, 19 Jul 2016 08:54:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPUXT-0003JU-KW for qemu-devel@nongnu.org; Tue, 19 Jul 2016 08:54:23 -0400 Received: from mail-lf0-x230.google.com ([2a00:1450:4010:c07::230]:33607) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPUXT-0003Iz-CM for qemu-devel@nongnu.org; Tue, 19 Jul 2016 08:54:19 -0400 Received: by mail-lf0-x230.google.com with SMTP id b199so13468546lfe.0 for ; Tue, 19 Jul 2016 05:54:19 -0700 (PDT) From: riku.voipio@linaro.org Date: Tue, 19 Jul 2016 15:53:59 +0300 Message-Id: In-Reply-To: References: Subject: [Qemu-devel] [PULL 01/16] linux-user: fd_trans_*_data() returns the length List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Laurent Vivier From: Laurent Vivier fd_trans_target_to_host_data() and fd_trans_host_to_target_data() must return the length of processed data. Signed-off-by: Laurent Vivier Signed-off-by: Riku Voipio --- linux-user/syscall.c | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 8bf6205..59defff 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -2826,12 +2826,26 @@ static TargetFdTrans target_packet_trans = { #ifdef CONFIG_RTNETLINK static abi_long netlink_route_target_to_host(void *buf, size_t len) { - return target_to_host_nlmsg_route(buf, len); + abi_long ret; + + ret = target_to_host_nlmsg_route(buf, len); + if (ret < 0) { + return ret; + } + + return len; } static abi_long netlink_route_host_to_target(void *buf, size_t len) { - return host_to_target_nlmsg_route(buf, len); + abi_long ret; + + ret = host_to_target_nlmsg_route(buf, len); + if (ret < 0) { + return ret; + } + + return len; } static TargetFdTrans target_netlink_route_trans = { @@ -2842,12 +2856,26 @@ static TargetFdTrans target_netlink_route_trans = { static abi_long netlink_audit_target_to_host(void *buf, size_t len) { - return target_to_host_nlmsg_audit(buf, len); + abi_long ret; + + ret = target_to_host_nlmsg_audit(buf, len); + if (ret < 0) { + return ret; + } + + return len; } static abi_long netlink_audit_host_to_target(void *buf, size_t len) { - return host_to_target_nlmsg_audit(buf, len); + abi_long ret; + + ret = host_to_target_nlmsg_audit(buf, len); + if (ret < 0) { + return ret; + } + + return len; } static TargetFdTrans target_netlink_audit_trans = { -- 2.1.4