Page MenuHomePhabricator

fix broken off-by-one checks in imx8 plat_core_pos_by_mpidr()
Open, Needs TriagePublic

Description

The in plat/imx/common/imx8_topology.c plat_core_pos_by_mpidr() do are greater-than instead of a greater-or-equal compare on the cluster_id and cpu_id.

if (cluster_id > PLATFORM_CLUSTER_COUNT ||
    cpu_id > PLATFORM_MAX_CPU_PER_CLUSTER)
    return -1;

should instead be:

if (cluster_id >= PLATFORM_CLUSTER_COUNT ||
    cpu_id >= PLATFORM_MAX_CPU_PER_CLUSTER)
    return -1;

Event Timeline

cinap_lenrek updated the task description. (Show Details)

In ARM systems, the MPIDR is often used to identify a specific core, and in an SMP (Symmetric Multiprocessing) system, each core has a unique MPIDR value. The error likely arises when the MPIDR is used to access an array or check core position, and the boundaries are incorrectly set (off-by-one error). Press Release Marketing What are the best platforms for Press Release Marketing? Can you recommend platforms that will help promote my press release effectively?