zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
9.74k stars 6k forks source link

xtensa: userspace: fix uninitialized return values in mpu_map_region_add #72206

Open agiardin opened 2 weeks ago

agiardin commented 2 weeks ago

When CONFIG_XTENSA_MPU_ONLY_SOC_RANGES is enabled, the first region added to the MPU table is added to an empty table. mpu_map_region_add has a special section for handling this case, but it does not update the value of *first_idx which is returned to the caller. This results in returning a garbage value to the caller.

github-actions[bot] commented 2 weeks ago

Hello @agiardin, and thank you very much for your first pull request to the Zephyr project! Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary. If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊