Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rt_spi_sendrecv8()存在可能未初始化值返回的情况 #6008

Closed
Rrooach opened this issue May 28, 2022 · 0 comments
Closed

rt_spi_sendrecv8()存在可能未初始化值返回的情况 #6008

Rrooach opened this issue May 28, 2022 · 0 comments
Labels
bug This PR/issue is a bug in the current code.

Comments

@Rrooach
Copy link

Rrooach commented May 28, 2022

在函数rt_spi_sendrecv8中声明了value,后续调用函数rt_spi_send_then_recv(device, &data, 1, &value, 1)。

而在rt_spi_send_then_recv()时如果,在调用rt_mutex_take()后result的值不等于RT_EOK,则value将会在不被赋值的情况下返回,进而导致value在未被赋值的情况下返回,可能导致空指针引用等错误。

@mysterywolf mysterywolf added bug This PR/issue is a bug in the current code. v4.1.1 labels May 31, 2022
mysterywolf added a commit to mysterywolf/rt-thread that referenced this issue Jun 21, 2022
rt_spi_sendrecv8()存在可能未初始化值返回的情况
Guozhanxin pushed a commit that referenced this issue Jun 22, 2022
rt_spi_sendrecv8()存在可能未初始化值返回的情况
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This PR/issue is a bug in the current code.
Projects
None yet
Development

No branches or pull requests

2 participants