{"action":"created","issue":{"url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/10776","repository_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr","labels_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/10776/labels{/name}","comments_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/10776/comments","events_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/10776/events","html_url":"https://github.com/zephyrproject-rtos/zephyr/pull/10776","id":372826091,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI0OTA5Mjcx","number":10776,"title":"coccinelle: Add script to report cases of NULL dereference","user":{"login":"himanshujha199640","id":33165596,"node_id":"MDQ6VXNlcjMzMTY1NTk2","avatar_url":"https://avatars2.githubusercontent.com/u/33165596?v=4","gravatar_id":"","url":"https://api.github.com/users/himanshujha199640","html_url":"https://github.com/himanshujha199640","followers_url":"https://api.github.com/users/himanshujha199640/followers","following_url":"https://api.github.com/users/himanshujha199640/following{/other_user}","gists_url":"https://api.github.com/users/himanshujha199640/gists{/gist_id}","starred_url":"https://api.github.com/users/himanshujha199640/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/himanshujha199640/subscriptions","organizations_url":"https://api.github.com/users/himanshujha199640/orgs","repos_url":"https://api.github.com/users/himanshujha199640/repos","events_url":"https://api.github.com/users/himanshujha199640/events{/privacy}","received_events_url":"https://api.github.com/users/himanshujha199640/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-23T06:20:48Z","updated_at":"2018-10-23T06:49:03Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/pulls/10776","html_url":"https://github.com/zephyrproject-rtos/zephyr/pull/10776","diff_url":"https://github.com/zephyrproject-rtos/zephyr/pull/10776.diff","patch_url":"https://github.com/zephyrproject-rtos/zephyr/pull/10776.patch"},"body":"This script finds cases of NULL dereferences where a variable\r\nis dereferenced under a NULL test, even though it is known\r\nto be NULL.\r\n\r\nSigned-off-by: Himanshu Jha <himanshujha199640@gmail.com>\r\n\r\n```\r\nhimanshu@himanshu-Vostro-3559:~/zephyr$ ./scripts/coccicheck --mode=report --cocci=scripts/coccinelle/deref_null.cocci --verbose=1\r\n\r\nPlease check for false positives in the output before submitting a patch.\r\nWhen using \"patch\" mode, carefully review the patch before submitting it.\r\n\r\nProcessing deref_null.cocci\r\nwith option(s) \"\"\r\n\r\nMessage example to submit a patch:\r\n\r\n A variable is dereferenced under a NULL test.\r\n Even though it is known to be NULL.\r\n\r\n The semantic patch that makes this report is available\r\n in scripts/coccinelle/deref_null.cocci.\r\n\r\n More information about semantic patching is available at\r\n http://coccinelle.lip6.fr/\r\n\r\nRunning (4 in parallel): /usr/local/bin/spatch -D report --no-show-diff --very-quiet --cocci-file scripts/coccinelle/deref_null.cocci --dir /home/himanshu/zephyr --jobs 4 --chunksize 1\r\n/home/himanshu/zephyr/ext/lib/ipc/open-amp/open-amp/lib/remoteproc/drivers/zynqmp_remoteproc_r5.c:182:17-22: ERROR: ipi is NULL but dereferenced.\r\n/home/himanshu/zephyr/ext/hal/st/stm32cube/stm32l4xx/drivers/src/stm32l4xx_hal_i2c.c:604:10-19: ERROR: hi2c is NULL but dereferenced.\r\n/home/himanshu/zephyr/ext/hal/st/stm32cube/stm32l4xx/drivers/src/stm32l4xx_hal_i2c.c:494:10-19: ERROR: hi2c is NULL but dereferenced.\r\n/home/himanshu/zephyr/boards/posix/nrf52_bsim/bstests_entry.c:175:22-29: ERROR: current_test is NULL but dereferenced.\r\n/home/himanshu/zephyr/tests/net/net_pkt/src/main.c:448:16-19: ERROR: tfrag is NULL but dereferenced.\r\n/home/himanshu/zephyr/tests/net/net_pkt/src/main.c:448:33-36: ERROR: tfrag is NULL but dereferenced.\r\n/home/himanshu/zephyr/ext/lib/ipc/open-amp/open-amp/lib/remoteproc/drivers/zynqmp_remoteproc_a53.c:224:17-22: ERROR: ipi is NULL but dereferenced.\r\n```"},"comment":{"url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/comments/432116150","html_url":"https://github.com/zephyrproject-rtos/zephyr/pull/10776#issuecomment-432116150","issue_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/10776","id":432116150,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjExNjE1MA==","user":{"login":"codecov-io","id":8655789,"node_id":"MDQ6VXNlcjg2NTU3ODk=","avatar_url":"https://avatars0.githubusercontent.com/u/8655789?v=4","gravatar_id":"","url":"https://api.github.com/users/codecov-io","html_url":"https://github.com/codecov-io","followers_url":"https://api.github.com/users/codecov-io/followers","following_url":"https://api.github.com/users/codecov-io/following{/other_user}","gists_url":"https://api.github.com/users/codecov-io/gists{/gist_id}","starred_url":"https://api.github.com/users/codecov-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codecov-io/subscriptions","organizations_url":"https://api.github.com/users/codecov-io/orgs","repos_url":"https://api.github.com/users/codecov-io/repos","events_url":"https://api.github.com/users/codecov-io/events{/privacy}","received_events_url":"https://api.github.com/users/codecov-io/received_events","type":"User","site_admin":false},"created_at":"2018-10-23T06:49:03Z","updated_at":"2018-10-23T06:49:03Z","author_association":"NONE","body":"# [Codecov](https://codecov.io/gh/zephyrproject-rtos/zephyr/pull/10776?src=pr&el=h1) Report\n> Merging [#10776](https://codecov.io/gh/zephyrproject-rtos/zephyr/pull/10776?src=pr&el=desc) into [master](https://codecov.io/gh/zephyrproject-rtos/zephyr/commit/7cea94942c35bb65a8c219b69ec2270c0fedd6f4?src=pr&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[![Impacted file tree graph](https://codecov.io/gh/zephyrproject-rtos/zephyr/pull/10776/graphs/tree.svg?width=650&token=ftaqgO8OOj&height=150&src=pr)](https://codecov.io/gh/zephyrproject-rtos/zephyr/pull/10776?src=pr&el=tree)\n\n```diff\n@@           Coverage Diff           @@\n##           master   #10776   +/-   ##\n=======================================\n  Coverage   55.03%   55.03%           \n=======================================\n  Files         206      206           \n  Lines       24880    24880           \n  Branches     5494     5494           \n=======================================\n  Hits        13693    13693           \n  Misses       8883     8883           \n  Partials     2304     2304\n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/zephyrproject-rtos/zephyr/pull/10776?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/zephyrproject-rtos/zephyr/pull/10776?src=pr&el=footer). Last update [7cea949...20a1b7f](https://codecov.io/gh/zephyrproject-rtos/zephyr/pull/10776?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n"}}
{"actor":{"display_login":"codecov-io"}}