File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -299,6 +299,12 @@ static struct rxrpc_peer *rxrpc_create_peer(struct rxrpc_sock *rx,
299
299
return peer ;
300
300
}
301
301
302
+ static void rxrpc_free_peer (struct rxrpc_peer * peer )
303
+ {
304
+ rxrpc_put_local (peer -> local );
305
+ kfree_rcu (peer , rcu );
306
+ }
307
+
302
308
/*
303
309
* Set up a new incoming peer. There shouldn't be any other matching peers
304
310
* since we've already done a search in the list from the non-reentrant context
@@ -365,7 +371,7 @@ struct rxrpc_peer *rxrpc_lookup_peer(struct rxrpc_sock *rx,
365
371
spin_unlock_bh (& rxnet -> peer_hash_lock );
366
372
367
373
if (peer )
368
- kfree (candidate );
374
+ rxrpc_free_peer (candidate );
369
375
else
370
376
peer = candidate ;
371
377
}
@@ -420,8 +426,7 @@ static void __rxrpc_put_peer(struct rxrpc_peer *peer)
420
426
list_del_init (& peer -> keepalive_link );
421
427
spin_unlock_bh (& rxnet -> peer_hash_lock );
422
428
423
- rxrpc_put_local (peer -> local );
424
- kfree_rcu (peer , rcu );
429
+ rxrpc_free_peer (peer );
425
430
}
426
431
427
432
/*
@@ -457,8 +462,7 @@ void rxrpc_put_peer_locked(struct rxrpc_peer *peer)
457
462
if (n == 0 ) {
458
463
hash_del_rcu (& peer -> hash_link );
459
464
list_del_init (& peer -> keepalive_link );
460
- rxrpc_put_local (peer -> local );
461
- kfree_rcu (peer , rcu );
465
+ rxrpc_free_peer (peer );
462
466
}
463
467
}
464
468
You can’t perform that action at this time.
0 commit comments