From 2204c61a4f85b14685f6dca6bbfac8adac6e2810 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 9 Dec 2011 13:09:23 -0800 Subject: [PATCH] lacp: Avoid valgrind warning in lacp_configure() if custom timing not used. The caller currently doesn't fill in s->custom_time unless it actually wants a custom LACP time, but lacp_configure() still does a calculation with it, provoking a warning from valgrind. This eliminates the warning. The calculated value was not actually used in this case, so this commit does not fix a real bug. --- lib/lacp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/lacp.c b/lib/lacp.c index 2b779961..edf7f679 100644 --- a/lib/lacp.c +++ b/lib/lacp.c @@ -243,7 +243,9 @@ lacp_configure(struct lacp *lacp, const struct lacp_settings *s) lacp->active = s->active; lacp->lacp_time = s->lacp_time; - lacp->custom_time = MAX(TIME_UPDATE_INTERVAL, s->custom_time); + lacp->custom_time = (s->lacp_time == LACP_TIME_CUSTOM + ? MAX(TIME_UPDATE_INTERVAL, s->custom_time) + : 0); } /* Returns true if 'lacp' is configured in active mode, false if 'lacp' is -- 2.30.2