Skip to content

Commit 9fbe465

Browse files
jan-kiszkajwessel
authored andcommitted
kgdb: Respect that flush op is optional
Not all kgdb I/O drivers implement a flush operation. Adjust gdbstub_exit accordingly. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
1 parent 639077f commit 9fbe465

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

kernel/debug/gdbstub.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1129,5 +1129,6 @@ void gdbstub_exit(int status)
11291129
dbg_io_ops->write_char(hex_asc_lo(checksum));
11301130

11311131
/* make sure the output is flushed, lest the bootloader clobber it */
1132-
dbg_io_ops->flush();
1132+
if (dbg_io_ops->flush)
1133+
dbg_io_ops->flush();
11331134
}

0 commit comments

Comments
 (0)