rxrpc: Fix rxrpc_peer leak in rxrpc_look_up_bundle()
authorEiichi Tsukata <eiichi.tsukata@nutanix.com>
Sun, 21 Nov 2021 04:16:07 +0000 (04:16 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Dec 2021 08:03:25 +0000 (09:03 +0100)
commit35b40f724c4ef0f683d94dab3af9ab38261d782b
treeeb57b6cb7865f99f91d2e5390e38644cf78beb10
parent4afb32090a1518e3325970ee9eb6ddbd9e3dd6ef
rxrpc: Fix rxrpc_peer leak in rxrpc_look_up_bundle()

commit ca77fba821351190777b236ce749d7c4d353102e upstream.

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

[DH: v2: Changed to abstract out the bundle freeing code into a function]

Fixes: 245500d853e9 ("rxrpc: Rewrite the client connection manager")
Signed-off-by: Eiichi Tsukata <eiichi.tsukata@nutanix.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Link: https://lore.kernel.org/r/20211121041608.133740-1-eiichi.tsukata@nutanix.com/
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/rxrpc/conn_client.c