Skip to content

Commit 80adcdf

Browse files
committed
sof-logger: print error if -u uart option is given with no infile
sof-logger -u 115200 -d /lib/firmware/sof-foo.ldc Leads to silent failure as a NULL is passed to open(). Add explicit error handling for this case. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
1 parent bf7aa04 commit 80adcdf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/logger/logger.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,11 @@ int main(int argc, char *argv[])
441441
if (!config.in_file && !config.dump_ldc)
442442
config.in_file = "/sys/kernel/debug/sof/etrace";
443443

444+
if (!config.in_file && baud) {
445+
fprintf(stderr, "error: No UART device specified\n");
446+
usage();
447+
}
448+
444449
if (config.input_std) {
445450
config.in_fd = stdin;
446451
} else if (baud) {

0 commit comments

Comments
 (0)