[riot-notifications] [RIOT-OS/RIOT] gnrc_netreg: bail out if type is not registered (#16629)

benpicco notifications at github.com
Thu Jul 8 16:59:44 CEST 2021


@benpicco commented on this pull request.



> @@ -95,7 +95,9 @@ static gnrc_netreg_entry_t *_netreg_lookup(gnrc_netreg_entry_t *from,
 
     if (from || !_INVALID_TYPE(type)) {
         gnrc_netreg_entry_t *head = (from) ? from->next : netreg[type];
-        LL_SEARCH_SCALAR(head, res, demux_ctx, demux_ctx);
+        if (head) {
+            LL_SEARCH_SCALAR(head, res, demux_ctx, demux_ctx);

Hm you are right, this resolved to [`LL_FOREACH2`](https://github.com/RIOT-OS/RIOT/blob/master/sys/include/utlist.h#L473) which should not loop if `head` is NULL.

So something else must happen here.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16629#discussion_r666275236
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210708/3f9bf3b4/attachment.htm>


More information about the notifications mailing list