lib: fix SA warning in typesafe code

There's a nagging SA warning, at least with the scan-build
version we use in the FRR CI.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
This commit is contained in:
Mark Stapp 2022-07-05 16:31:41 -04:00
parent 211f1157ee
commit f580074e61

View File

@ -309,6 +309,7 @@ static inline void typesafe_dlist_add(struct dlist_head *head,
struct dlist_item *prev, struct dlist_item *item)
{
item->next = prev->next;
if (item->next)
item->next->prev = item;
item->prev = prev;
prev->next = item;