Skip to content

Possibility of data corruption in RequestResponse logic #59

@DeeFuse

Description

@DeeFuse

I think there is a possible data corruption possibility in the response sending code here:

int err = thingset_can_send_inst(ts_can, sbuf->data, tx_len, target_addr, route,
NULL, NULL, K_NO_WAIT);
if (err != 0) {
k_sem_give(&sbuf->lock);
}

The semaphore will be released bevore the transmission is completed, which may take some time in case of a large reply.
I think the semaphore shall be released in a sent callback handler instead of right after the transmission has been initialized.

might be related to #57

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions