From mboxrd@z Thu Jan 1 00:00:00 1970 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) 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" Date: Tue, 16 Feb 2016 12:53:32 +0100 Message-Id: <1455623612-24398-1-git-send-email-edgar.iglesias@gmail.com> Subject: [Qemu-devel] [PATCH v1 1/1] etraxfs_dma: Dont forward zero-length payload to clients List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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; -- 1.9.1