fix: bsp/stm32: drv_qspi: zero-initialize qspi_device struct - #11656
fix: bsp/stm32: drv_qspi: zero-initialize qspi_device struct#11656jiaoxy0 wants to merge 1 commit into
Conversation
rt_hw_qspi_device_attach() allocates qspi_device via rt_malloc() but does not zero it, leaving uninitialized fields with random values. Add rt_memset() to prevent undefined behavior. Signed-off-by: jiaoxy0 <jiaoxiaoyu0@163.com>
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
📌 Code Review Assignment🏷️ Tag: bsp_stm32Reviewers: @Liang1795 @hamburger-os @wdfk-prog Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2026-07-23 23:52 CST)
📝 Review Instructions
|
|
|
rt_hw_qspi_device_attach() allocates qspi_device via rt_malloc() but does not zero it, leaving uninitialized fields with random values. This can cause undefined behavior when fields like enter_qspi_mode are checked before being explicitly set.
Fix: Add rt_memset() right after allocation and error check.