[Pdbg] [PATCH 1/7] libpdbg: If memory op fails, do not show progress

Amitay Isaacs amitay at ozlabs.org
Thu Oct 24 12:48:41 AEDT 2019


Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
---
 libpdbg/sbefifo.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/libpdbg/sbefifo.c b/libpdbg/sbefifo.c
index 030e6e9..a448107 100644
--- a/libpdbg/sbefifo.c
+++ b/libpdbg/sbefifo.c
@@ -75,12 +75,11 @@ static int sbefifo_op_getmem(struct mem *sbefifo_mem,
 		flags |= SBEFIFO_MEMORY_FLAG_CI;
 
 	rc = sbefifo_mem_get(sbefifo->sf_ctx, start_addr, len, flags, &out);
-
-	pdbg_progress_tick(len, len);
-
 	if (rc)
 		return rc;
 
+	pdbg_progress_tick(len, len);
+
 	memcpy(data, out+offset, size);
 	free(out);
 
@@ -127,10 +126,12 @@ static int sbefifo_op_putmem(struct mem *sbefifo_mem,
 		flags |= SBEFIFO_MEMORY_FLAG_CI;
 
 	rc = sbefifo_mem_put(sbefifo->sf_ctx, addr, data, len, flags);
+	if (rc)
+		return rc;
 
 	pdbg_progress_tick(len, len);
 
-	return rc;
+	return 0;
 }
 
 static int sbefifo_op_control(struct sbefifo *sbefifo,
-- 
2.21.0



More information about the Pdbg mailing list