All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.01.org
Subject: [PATCH v4 3/3] erp: take cache ref in erp_new
Date: Tue, 03 Aug 2021 14:40:45 -0700	[thread overview]
Message-ID: <20210803214045.153011-3-prestwoj@gmail.com> (raw)
In-Reply-To: <20210803214045.153011-1-prestwoj@gmail.com>

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

Since the erp_state is holding a pointer to the ERP cache, as
well as calling erp_cache_put on free, it should take a reference
for symmetry.
---
 src/erp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/erp.c b/src/erp.c
index 4db32feb..59e6033c 100644
--- a/src/erp.c
+++ b/src/erp.c
@@ -336,6 +336,7 @@ struct erp_state *erp_new(struct erp_cache_entry *cache,
 	erp->tx_packet = tx_packet;
 	erp->user_data = user_data;
 	erp->cache = cache;
+	cache->ref++;
 
 	return erp;
 }
-- 
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 ` [PATCH v4 2/3] handshake: unref erp_cache when handshake is freed James Prestwood
2021-08-03 21:40 ` James Prestwood [this message]

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-3-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.