From patchwork Tue Feb 16 11:53:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 8324421 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 38268C02AA for ; Tue, 16 Feb 2016 11:53:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9770F2027D for ; Tue, 16 Feb 2016 11:53:52 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id DA17B201F4 for ; Tue, 16 Feb 2016 11:53:51 +0000 (UTC) Received: from localhost ([::1]:44821 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVeCV-0000u2-5D for patchwork-qemu-devel@patchwork.kernel.org; Tue, 16 Feb 2016 06:53:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVeCM-0000th-U3 for qemu-devel@nongnu.org; Tue, 16 Feb 2016 06:53:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVeCJ-0000pp-5T for qemu-devel@nongnu.org; Tue, 16 Feb 2016 06:53:42 -0500 Received: from mail-pf0-x236.google.com ([2607:f8b0:400e:c00::236]:36347) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVeCI-0000pY-U0 for qemu-devel@nongnu.org; Tue, 16 Feb 2016 06:53:39 -0500 Received: by mail-pf0-x236.google.com with SMTP id e127so104255635pfe.3 for ; Tue, 16 Feb 2016 03:53:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=7SuGNW6f5Gx10x+hLkWegdazsYKFAIJJW+a7lXHZEUw=; b=063MI1vtgwBk64MIVh4aQYodwFn8GAxpc4SWTkkl1NAGgKZMW8RxIFP7tYSWFg2plz b4CrQNXiZsAOl2o6Nj6QTnugQnaxxEpiqqXRT+FBgQFOisxen59XHBxZ7dMQBIrtXY6o ee6bk57iDLTzz/EIqSYvCidL2chIe8osj9hADJib5hObxSVB/CU1AB5VgFbJi/S2VuF2 RJErbSYs9H08IA8BypHlaXu6S+K2SuQvxStDvsHoll77ouiuNeSy7ZaZDgg7jZOcq5l8 zVNkpypd6FHQH9xeDuXc1VuaE1W875QA2pVA9GOJOIrcwcJ8mmDhZDQd5Cky3j83BnzR if2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=7SuGNW6f5Gx10x+hLkWegdazsYKFAIJJW+a7lXHZEUw=; b=FSFM9gZs4LJiS3Mw3SCA9Kb0zW5z46Pe7IglRoRLiKuANpCsojO5C6lKYRBICmUata qmQ0p0gDysSh5Re5MAGvsid7902buTgEqIXvGPi/gLtmux8OLh1ufKfZ9lavYAFiuWGt c0AIGYOUbxB2e+QDD/5FgvsWct6X1sUHu4IxrOYJYnTMJ/ohqVAE/Re4J0SeZePR/Pt5 bsc+KzOnZhkCaB2hkLqBDjXPut1W/8wK/FfOAHumZokKRpEdhxH478EqAdiFhks2Ia/b wLKJr95ufwFmUsS2v8g7orzra+bcRG4akBLGm1UXt+Vp3pBhcWjuvcHTtrki3bqzJKom Yglw== X-Gm-Message-State: AG10YOTMVnOkeAmG7lnkLeBGOPwq9eqqaMGc9zpb5xYK8k4R/3e3S5iVC2cv24JK6uhdlQ== X-Received: by 10.98.9.129 with SMTP id 1mr30613252pfj.163.1455623617870; Tue, 16 Feb 2016 03:53:37 -0800 (PST) Received: from localhost (ec2-52-8-89-49.us-west-1.compute.amazonaws.com. [52.8.89.49]) by smtp.gmail.com with ESMTPSA id kw10sm45415396pab.0.2016.02.16.03.53.34 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 16 Feb 2016 03:53:34 -0800 (PST) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Date: Tue, 16 Feb 2016 12:53:32 +0100 Message-Id: <1455623612-24398-1-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 1.9.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c00::236 Subject: [Qemu-devel] [PATCH v1 1/1] etraxfs_dma: Dont forward zero-length payload to clients X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "Edgar E. Iglesias" Signed-off-by: Edgar E. Iglesias --- hw/dma/etraxfs_dma.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/hw/dma/etraxfs_dma.c b/hw/dma/etraxfs_dma.c index 9cbb165..d5650eb 100644 --- a/hw/dma/etraxfs_dma.c +++ b/hw/dma/etraxfs_dma.c @@ -440,13 +440,16 @@ static int channel_out_run(struct fs_dma_ctrl *ctrl, int c) D(printf("channel %d pushes %x %u bytes eop=%u\n", c, saved_data_buf, len, out_eop)); - if (ctrl->channels[c].client->client.push) - ctrl->channels[c].client->client.push( - ctrl->channels[c].client->client.opaque, - buf, len, out_eop); - else + if (ctrl->channels[c].client->client.push) { + if (len > 0) { + ctrl->channels[c].client->client.push( + ctrl->channels[c].client->client.opaque, + buf, len, out_eop); + } + } else { printf("WARNING: DMA ch%d dataloss," " no attached client.\n", c); + } saved_data_buf += len;