linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eiichi Tsukata <eiichi.tsukata@nutanix.com>
To: dhowells@redhat.com, marc.dionne@auristor.com,
	davem@davemloft.net, kuba@kernel.org,
	linux-afs@lists.infradead.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Eiichi Tsukata <eiichi.tsukata@nutanix.com>
Subject: [PATCH net 1/2] rxrpc: Fix rxrpc_peer leak in rxrpc_look_up_bundle()
Date: Sun, 21 Nov 2021 04:16:07 +0000	[thread overview]
Message-ID: <20211121041608.133740-1-eiichi.tsukata@nutanix.com> (raw)

Need to call rxrpc_put_peer() for bundle candidate before kfree() as it
holds a ref to rxrpc_peer.

Fixes: 245500d853e9 ("rxrpc: Rewrite the client connection manager")
Signed-off-by: Eiichi Tsukata <eiichi.tsukata@nutanix.com>
---
 net/rxrpc/conn_client.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/rxrpc/conn_client.c b/net/rxrpc/conn_client.c
index dbea0bfee48e..46dcb33888ff 100644
--- a/net/rxrpc/conn_client.c
+++ b/net/rxrpc/conn_client.c
@@ -328,6 +328,7 @@ static struct rxrpc_bundle *rxrpc_look_up_bundle(struct rxrpc_conn_parameters *c
 	return candidate;
 
 found_bundle_free:
+	rxrpc_put_peer(candidate->params.peer);
 	kfree(candidate);
 found_bundle:
 	rxrpc_get_bundle(bundle);
-- 
2.33.1


             reply	other threads:[~2021-11-21  4:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-21  4:16 Eiichi Tsukata [this message]
2021-11-21  4:16 ` [PATCH net 2/2] rxrpc: Fix rxrpc_local leak in rxrpc_lookup_peer() Eiichi Tsukata
2021-11-23 14:11   ` Marc Dionne
2021-11-23 14:12 ` [PATCH net 1/2] rxrpc: Fix rxrpc_peer leak in rxrpc_look_up_bundle() Marc Dionne
2021-11-24 14:21 ` David Howells
2021-11-29 15:49 [PATCH net 0/2] rxrpc: Leak fixes David Howells
2021-11-29 15:49 ` [PATCH net 1/2] rxrpc: Fix rxrpc_peer leak in rxrpc_look_up_bundle() David Howells

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=20211121041608.133740-1-eiichi.tsukata@nutanix.com \
    --to=eiichi.tsukata@nutanix.com \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=kuba@kernel.org \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.dionne@auristor.com \
    --cc=netdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).