Skip to content

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

Closed
@Rrooach

Description

@Rrooach

在函数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在未被赋值的情况下返回,可能导致空指针引用等错误。

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis PR/issue is a bug in the current code.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions