mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 03:27:03 +02:00
soc: qcom: socinfo: correct partid conditional check
Current code can end up accessing SOCINFO_PART_MAX_PARTTYPE for partid in certain scenarios which isn't desired, correct the check. Change-Id: Ida1ff23993d7dad93e5dd0635d3bfecac4c35201 Signed-off-by: Gokul krishna Krishnakumar <quic_gokukris@quicinc.com> Signed-off-by: Guru Das Srinagesh <quic_gurus@quicinc.com>
This commit is contained in:
parent
2a7bfbda9f
commit
7d64ef7bbf
|
|
@ -1565,7 +1565,7 @@ EXPORT_SYMBOL(socinfo_get_pcode);
|
|||
|
||||
char *socinfo_get_partinfo_details(unsigned int part_id)
|
||||
{
|
||||
if (socinfo_format < SOCINFO_VERSION(0, 16) || part_id > SOCINFO_PART_MAX_PARTTYPE)
|
||||
if (socinfo_format < SOCINFO_VERSION(0, 16) || part_id >= SOCINFO_PART_MAX_PARTTYPE)
|
||||
return NULL;
|
||||
|
||||
return partinfo[part_id].part_name;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user