From d7febe33f6b054c46e61780b34ab69b66bdda59f Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 8 Nov 2022 14:35:35 +0200 Subject: [PATCH] MLO: Remove unnecessary debug prints about clearing AP RSNE/RSNXE There is no help from seeing 32 lines of debug prints about clearing AP's RSNE/RSNXE information for each potential link when such information has not been set in the first place. These were printed even when there is no use of MLO whatsoever, so get rid of the prints for any case where the value has not yet been set. Signed-off-by: Jouni Malinen --- src/rsn_supp/wpa.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c index 0507c1a1d..cd6e7575b 100644 --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c @@ -4119,8 +4119,10 @@ int wpa_sm_set_mlo_params(struct wpa_sm *sm, const struct wpa_sm_mlo *mlo) len = mlo->links[i].ap_rsne_len; os_free(sm->mlo.links[i].ap_rsne); if (!ie || len == 0) { - wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, - "RSN: Clearing MLO link[%u] AP RSNE", i); + if (sm->mlo.links[i].ap_rsne) + wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, + "RSN: Clearing MLO link[%u] AP RSNE", + i); sm->mlo.links[i].ap_rsne = NULL; sm->mlo.links[i].ap_rsne_len = 0; } else { @@ -4138,8 +4140,10 @@ int wpa_sm_set_mlo_params(struct wpa_sm *sm, const struct wpa_sm_mlo *mlo) len = mlo->links[i].ap_rsnxe_len; os_free(sm->mlo.links[i].ap_rsnxe); if (!ie || len == 0) { - wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, - "RSN: Clearing MLO link[%u] AP RSNXE", i); + if (sm->mlo.links[i].ap_rsnxe) + wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, + "RSN: Clearing MLO link[%u] AP RSNXE", + i); sm->mlo.links[i].ap_rsnxe = NULL; sm->mlo.links[i].ap_rsnxe_len = 0; } else {