From patchwork Tue Jul 19 12:53:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 9237031 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1B11F6075D for ; Tue, 19 Jul 2016 12:55:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0CA6F26A4D for ; Tue, 19 Jul 2016 12:55:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0179526B41; Tue, 19 Jul 2016 12:55:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E17A426A4D for ; Tue, 19 Jul 2016 12:54:58 +0000 (UTC) Received: from localhost ([::1]:55675 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPUY5-00075M-Fi for patchwork-qemu-devel@patchwork.kernel.org; Tue, 19 Jul 2016 08:54:57 -0400 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=emft4QAr1OphAyOx8fofo7zRsMk1RQ8fovkKF+N2de8=; b=G680X8jcU/yWReIaaHmdOSBUfpbIgChnoNCFdjU55x/zdiIZJob0CTBlFly0jd14rn XRNDXrvcapkS4NdZU3Se+pjZBaS/87yrdj2/wzj8DQhiw2woAKewfH0M+Ca7GamULFFG W8hmOvOHY+tVWw/v/CTKD5lJUzYco8ZSMsVds= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=emft4QAr1OphAyOx8fofo7zRsMk1RQ8fovkKF+N2de8=; b=XJspWKDYgXglTKKjMyjTr0OxtWeMi9aUPC8WkUSR33E81mruhDgNKNV2eU591wVWIP c+qGA7sBmHbz+nslj5GB8zAZo1MBxGv55izekhwWe2JfEluobKA9ElV7t9huQP6Y07L7 RNrcFhximnx35sURRFksi7Nlt45fus6w4/Ovfz2S8fGnNh3/u4i0xODvxaO5fgZBFCJQ TesxfKGwSyenYYk75yGHhrp9ARL6n8lqn8bW8cwVUhgZ//gW2YoRWkxNSFe9dbkfoI2O 2lgHH52DEESgzEtRSSDI548FDLFgkmpT7cpcvbHc15cpIps8nBiOI8/XVGZfnYmZYTrx pORQ== X-Gm-Message-State: ALyK8tLNak8krIcGl2EpWtMhcJbi/j4xwV+gjdjfufAnsCSGEklGok56M0k3vi6OAt/f+wFo X-Received: by 10.25.79.132 with SMTP id d126mr9457172lfb.68.1468932858236; Tue, 19 Jul 2016 05:54:18 -0700 (PDT) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id g3sm2248898lfe.14.2016.07.19.05.54.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Jul 2016 05:54:17 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Tue, 19 Jul 2016 15:53:59 +0300 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::230 Subject: [Qemu-devel] [PULL 01/16] linux-user: fd_trans_*_data() returns the length X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 = {