Skip to content

Commit

Permalink
Merge pull request #1307 from IVOES/fix-inconsistent-null-check
Browse files Browse the repository at this point in the history
Added null check for return value of stlink_chipid_get_params().
  • Loading branch information
Nightwalker-87 committed Apr 29, 2023
2 parents c48d117 + 98902c2 commit 78b2893
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/st-trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,8 @@ int main(int argc, char **argv) {
if (!(stlink->chip_flags & CHIP_F_HAS_SWO_TRACING)) {
const struct stlink_chipid_params *params =
stlink_chipid_get_params(stlink->chip_id);
ELOG("We do not support SWO output for device '%s'\n", params->dev_type);
ELOG("We do not support SWO output for device '%s'\n",
params ? params->dev_type : "");
if (!settings.force)
return APP_RESULT_STLINK_UNSUPPORTED_DEVICE;
}
Expand Down

0 comments on commit 78b2893

Please sign in to comment.