[PATCH] ubusd: convert tx_queue to linked list

Petr Štetiar ynezz at true.cz
Tue Mar 23 16:16:18 GMT 2021


Arnout Vandecappelle (Essensium/Mind) <arnout at mind.be> [2021-03-23 16:23:25]:

Hi,

> To maintain the linked list, an additional structure ubus_msg_buf_list
> is created. We could also have added the linked list to the ubus_msg_buf
> struct itself, but it is not relevant in the many other uses of the
> ubus_msg_buf struct so it would just complicate things.

I've just tried to run CI pipeline[1] on this patch and got following complaints
from clang static analyzer[2]:

 ubusd_main.c:33:3: warning: Use of memory after it is freed [unix.Malloc]
                 ubus_msg_list_free(ubl);
                 ^~~~~~~~~~~~~~~~~~~~~~~

 ubusd_main.c:76:39: warning: Use of memory after it is freed [unix.Malloc]
                 written = ubus_msg_writev(sock->fd, ubl->msg, ubl->offset);
                                                     ^~~~~~~~

1. https://gitlab.com/ynezz/openwrt-ubus/-/pipelines/275104805
2. https://ynezz.gitlab.io/-/openwrt-ubus/-/jobs/1121145462/artifacts/build/scan/2021-03-23-154521-70-1/index.html

Cheers,

Petr



More information about the openwrt-devel mailing list