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 :208204] Arguments in wrong order in samples/subsys/canbus/isotp/src/main.c #22645

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#L67

Category: API usage errors
Function: rx_8_0_thread
Component: Samples
CID: 208204

Details:

61         ARG_UNUSED(arg3);
62         int ret, rem_len, received_len;
63         struct net_buf *buf;
64         static u8_t rx_buffer[7];
65    
66    
>>>     CID 208204:  API usage errors  (SWAPPED_ARGUMENTS)
>>>     The positions of arguments in the call to "isotp_bind" do not match the ordering of the parameters:
67         ret = isotp_bind(&recv_ctx_8_0, can_dev,
68                  &tx_addr_8_0, &rx_addr_8_0,
69                  &fc_opts_8_0, K_FOREVER);
70         if (ret != ISOTP_N_OK) {
71             printk("Failed to bind to rx ID %d [%d]\n",
72                    rx_addr_8_0.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