Skip to content

Conversation

@kv2019i
Copy link
Collaborator

@kv2019i kv2019i commented Dec 19, 2022

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

Copy link
Collaborator

@paulstelian97 paulstelian97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised this is in here in the first place. There may be another place to check this but here is good too and should be no issue.

@paulstelian97
Copy link
Collaborator

Oh actually maybe a warning that e.g. the uart isn't used and the regular etrace/DMA trace file is being read instead could be good? Since you're not aborting the program...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fprintf(stderr, "error: Input file not specified with -u option\n");
fprintf(stderr, "error: Input file not specified with -i option\n");

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kv2019i you thumbed up my comment and resolved it but made no change.

PS: thanks to eagle-eyed @ranj063 for spotting this.

Maybe even better:

Suggested change
fprintf(stderr, "error: Input file not specified with -u option\n");
fprintf(stderr, "error: Input device not specified with -i option\n");

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marc-hb Sorry, I didn't you had a different issue. Ok, I'll rephrase that message.

@kv2019i
Copy link
Collaborator Author

kv2019i commented Dec 19, 2022

@paulstelian97 wrote:

Oh actually maybe a warning that e.g. the uart isn't used and the regular etrace/DMA trace file is being read
instead could be good? Since you're not aborting the program...

....a bit of surprise (to me as well), but usage() actually calls exit, so the program does exit here.

@kv2019i kv2019i requested a review from marc-hb December 19, 2022 19:41
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kv2019i you thumbed up my comment and resolved it but made no change.

PS: thanks to eagle-eyed @ranj063 for spotting this.

Maybe even better:

Suggested change
fprintf(stderr, "error: Input file not specified with -u option\n");
fprintf(stderr, "error: Input device not specified with -i option\n");

@kv2019i kv2019i requested a review from marc-hb December 20, 2022 09:46
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>
@kv2019i kv2019i force-pushed the 202212-soflogger-uart-fix branch from cb4eb34 to 34c8fe3 Compare December 20, 2022 13:21
@kv2019i
Copy link
Collaborator Author

kv2019i commented Dec 20, 2022

@marc-hb Now updated.

@kv2019i kv2019i added the P1 Blocker bugs or important features label Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P1 Blocker bugs or important features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants