Skip to content

Commit

Permalink
dev_tree: Fix null pointer dereference if model is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
stephan-gh committed Jan 24, 2021
1 parent f36005a commit a8307c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions platform/msm_shared/dev_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ static int dev_tree_compatible(void *dtb, uint32_t dtb_size, struct dt_entry_nod
cur_dt_entry->size = dtb_size;

dprintf(SPEW, "Found an appended flattened device tree (%s - %u %u 0x%x)\n",
*model ? model : "unknown",
model ? model : "unknown",
cur_dt_entry->platform_id, cur_dt_entry->variant_id, cur_dt_entry->soc_rev);

if (platform_dt_absolute_match(cur_dt_entry, dtb_list)) {
Expand Down Expand Up @@ -390,7 +390,7 @@ static int dev_tree_compatible(void *dtb, uint32_t dtb_size, struct dt_entry_nod

for (i=0 ;i < num_entries; i++) {
dprintf(SPEW, "Found an appended flattened device tree (%s - %u %u %u 0x%x)\n",
*model ? model : "unknown",
model ? model : "unknown",
dt_entry_array[i].platform_id, dt_entry_array[i].variant_id, dt_entry_array[i].board_hw_subtype, dt_entry_array[i].soc_rev);

if (platform_dt_absolute_match(&(dt_entry_array[i]), dtb_list)) {
Expand Down

0 comments on commit a8307c5

Please sign in to comment.