Skip to content

Commit

Permalink
smem: Default to unknown platform if hardware id is out of range
Browse files Browse the repository at this point in the history
  • Loading branch information
Sorixelle authored and Junak committed Aug 1, 2020
1 parent d8b0d75 commit 511e22a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions platform/msm_shared/smem.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ size_t smem_get_hw_platform_name(void *buf, uint32 buf_size)
}

hw_id = board_hardware_id();
if (hw_id >= ARRAY_SIZE(hw_platform) || hw_platform[hw_id] == '\0')
return 1;
if (hw_id >= ARRAY_SIZE(hw_platform))
hw_id = HW_PLATFORM_UNKNOWN;

if (buf_size < strlen(hw_platform[hw_id]) + 1)
return 1;
Expand Down

0 comments on commit 511e22a

Please sign in to comment.