Skip to contentSkip to conversation

etraxfs_dma: Dont forward zero-length payload to clients

PATCH Applied Edgar E. Iglesias 1 participant 2 messages Feb 16, 2016 – Feb 19, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 etraxfs_dma: Dont forward zero-length payload to clients

From: "Edgar E. Iglesias" <[email protected]>

---
 hw/dma/etraxfs_dma.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
hw/dma/etraxfs_dma.c +8 -5
index 9cbb165..d5650eb 100644
@@ -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;
 
Signature · 1 line
1.9.1
author Applied
#1 lore raw
Quoted 1 line · Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

Applied

Quoted 35 lines
---
 hw/dma/etraxfs_dma.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
hw/dma/etraxfs_dma.c +8 -5
index 9cbb165..d5650eb 100644
@@ -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;
 
Signature · 1 line
1.9.1