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

[Coverity CID :208202] Arguments in wrong order in samples/subsys/canbus/isotp/src/main.c #22647

Closed
zephyrbot opened this issue Feb 9, 2020 · 1 comment
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug

Comments

@zephyrbot
Copy link
Collaborator

Static code scan issues found in file:

https://github.com/zephyrproject-rtos/zephyr/tree/e089906b339aad4cd1b6589a3b6ce94782d93f54/samples/subsys/canbus/isotp/src/main.c#L112

Category: API usage errors
Function: rx_0_5_thread
Component: Samples
CID: 208202

Details:

106         ARG_UNUSED(arg1);
107         ARG_UNUSED(arg2);
108         ARG_UNUSED(arg3);
109         int ret, received_len;
110         static u8_t rx_buffer[32];
111    
>>>     CID 208202:  API usage errors  (SWAPPED_ARGUMENTS)
>>>     The positions of arguments in the call to "isotp_bind" do not match the ordering of the parameters:
112         ret = isotp_bind(&recv_ctx_0_5, can_dev,
113                  &tx_addr_0_5, &rx_addr_0_5,
114                  &fc_opts_0_5, K_FOREVER);
115         if (ret != ISOTP_N_OK) {
116             printk("Failed to bind to rx ID %d [%d]\n",
117                    rx_addr_0_5.std_id, ret);

Please fix or provide comments in coverity using the link:

https://scan9.coverity.com/reports.htm#v32951/p12996.

Note: This issue was created automatically. Priority was set based on classification
of the file affected and the impact field in coverity. Assignees were set using the CODEOWNERS file.

@zephyrbot zephyrbot added bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug labels Feb 9, 2020
@nashif nashif assigned alexanderwachter and unassigned nashif Feb 9, 2020
@alexanderwachter
Copy link
Member

Intentional. We have receiver and sender on the same node, so we need to switch the addresses somewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug
Projects
None yet
Development

No branches or pull requests

3 participants