From f6657a6ef3634532fad196070def6bdbb3c1e8b9 Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Thu, 27 Oct 2022 10:11:25 +0200 Subject: [PATCH] lib: fix coverity scan failure in zebra_interface_link_params_read() The code was working but the coverity scan reported a failure. Clarify the code to make the coverity scan happy. Fixes: fe0a129687 ("lib,zebra: link-params are not flushed after no enable") Signed-off-by: Louis Scalbert --- lib/zclient.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/zclient.c b/lib/zclient.c index f5d45b40ef..4a553f4718 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -2370,8 +2370,7 @@ struct interface *zebra_interface_link_params_read(struct stream *s, return NULL; } - iflp = if_link_params_get(ifp); - if (iflp) { + if (if_link_params_get(ifp)) { iflp_prev_set = true; memcpy(&iflp_prev, ifp->link_params, sizeof(iflp_prev)); } else @@ -2387,6 +2386,8 @@ struct interface *zebra_interface_link_params_read(struct stream *s, if (changed == NULL) return ifp; + iflp = if_link_params_get(ifp); + if (iflp_prev_set && iflp) { if (memcmp(&iflp_prev, iflp, sizeof(iflp_prev))) *changed = true; -- 2.39.5