diff mbox

[5/9] dm: Fix comma printing for the case when dm_target_msg structure is inaccessible

Message ID 20161011223842.GA8831@obsidian (mailing list archive)
State Not Applicable, archived
Delegated to: Mike Snitzer
Headers show

Commit Message

Eugene Syromyatnikov Oct. 11, 2016, 10:38 p.m. UTC
---
 dm.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/dm.c b/dm.c
index d846233..b1d455c 100644
--- a/dm.c
+++ b/dm.c
@@ -342,10 +342,12 @@  dm_decode_dm_target_msg(struct tcb *tcp, unsigned long addr,
 	    offset + target_msg_message_offs <= ioc->data_size) {
 		struct dm_target_msg s;
 
+		tprints(", ");
+
 		if (umove_or_printaddr(tcp, addr + offset, &s))
 			return;
 
-		tprintf(", {sector=%" PRI__u64 ", message=", s.sector);
+		tprintf("{sector=%" PRI__u64 ", message=", s.sector);
 		printstr_ex(tcp, addr + offset + target_msg_message_offs,
 			    ioc->data_size - offset - target_msg_message_offs,
 			    QUOTE_0_TERMINATED);