[riot-notifications] [RIOT-OS/RIOT] Missing error check of several functions (#15524)

HanXinrong notifications at github.com
Mon Nov 30 15:18:24 CET 2020

According to the RIOT API, ds3231_get_time() and ds3231_set_time() are used to get or set date and time from the device, and return 0 on success, or -EIO on I2C communication error. But as shown below, the return values of them have not been checked.
And in the same file, at the following call sites, they are error checked,
Function aes_encrypt() is to encrypt one plainBlock-block and save the result in cipherblock. It returns 1 on success, and a negative value if the cipher key cannot be expanded with the AES key schedule. In the following codes, there may be need an error check.
However, there are error checks from other call sites, for example,
The function cord_common_add_qstring() is used to add selected query string options to a gcoap request, and returns 0 on success, or a negative value on error. As follows, there could be add a check of the return value.
What's more, we can see a return value check of it in the fragment below.
Also, there may be a lack of error checks of function devfs_register(). It is to register a node in DevFS, and returns 0 on success, or a negative value on error. As shown below,
Moreover, there is a function test_devfs_register() to test the return values of devfs_register() at the following file. So I think, there will be a need of error checks at the above call sites.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20201130/d1d6eee1/attachment-0001.htm>

More information about the notifications mailing list