Wireless Daemon for Linux
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.01.org
Subject: [PATCH v4 2/3] handshake: unref erp_cache when handshake is freed
Date: Tue, 03 Aug 2021 14:40:44 -0700	[thread overview]
Message-ID: <20210803214045.153011-2-prestwoj@gmail.com> (raw)
In-Reply-To: <20210803214045.153011-1-prestwoj@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 765 bytes --]

This makes the erp_cache ownership more consisten rather than
relying on the ERP state to free the cache.
---
 src/handshake.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/handshake.c b/src/handshake.c
index 2bce6b8c..5f6b25f4 100644
--- a/src/handshake.c
+++ b/src/handshake.c
@@ -41,6 +41,7 @@
 #include "src/ie.h"
 #include "src/util.h"
 #include "src/handshake.h"
+#include "src/erp.h"
 
 static inline unsigned int n_ecc_groups()
 {
@@ -106,6 +107,9 @@ void handshake_state_free(struct handshake_state *s)
 	l_free(s->mde);
 	l_free(s->fte);
 
+	if (s->erp_cache)
+		erp_cache_put(s->erp_cache);
+
 	if (s->passphrase) {
 		explicit_bzero(s->passphrase, strlen(s->passphrase));
 		l_free(s->passphrase);
-- 
2.31.1

  parent reply	other threads:[~2021-08-03 21:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-03 21:40 [PATCH v4 1/3] station: network: rework ERP/FILS code path James Prestwood
2021-08-03 21:36 ` Denis Kenzior
2021-08-03 21:40 ` James Prestwood [this message]
2021-08-03 21:40 ` [PATCH v4 3/3] erp: take cache ref in erp_new James Prestwood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210803214045.153011-2-prestwoj@gmail.com \
    --to=prestwoj@gmail.com \
    --cc=iwd@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox