]> git.baikalelectronics.ru Git - kernel.git/commit
rxrpc: Fix rxrpc_local leak in rxrpc_lookup_peer()
authorEiichi Tsukata <eiichi.tsukata@nutanix.com>
Sun, 21 Nov 2021 04:16:08 +0000 (04:16 +0000)
committerDavid Howells <dhowells@redhat.com>
Mon, 29 Nov 2021 15:40:02 +0000 (15:40 +0000)
commit5883c65f68fcce55f8f2438a4fc261d55408b6b0
treea0d601adea98d9519779f70148d7e00ff7305fb4
parenteb4c22b32d2776d31cbba3eb171f9cba5543d5bd
rxrpc: Fix rxrpc_local leak in rxrpc_lookup_peer()

Need to call rxrpc_put_local() for peer candidate before kfree() as it
holds a ref to rxrpc_local.

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

Fixes: 574b95292075 ("rxrpc: rxrpc_peer needs to hold a ref on the rxrpc_local record")
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/all/20211121041608.133740-2-eiichi.tsukata@nutanix.com/
net/rxrpc/peer_object.c