Skip to content

Commit eaa0239

Browse files
dhowellsdavem330
authored andcommitted
rxrpc: Fix NULL deref in rxrpc_unuse_local()
Fix rxrpc_unuse_local() to get the debug_id *after* checking to see if local is NULL. Fixes: a2cf326 ("rxrpc: Fold __rxrpc_unuse_local() into rxrpc_unuse_local()") Reported-by: [email protected] Signed-off-by: David Howells <[email protected]> Tested-by: [email protected] cc: Marc Dionne <[email protected]> cc: [email protected] Signed-off-by: David S. Miller <[email protected]>
1 parent fdb9948 commit eaa0239

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/rxrpc/local_object.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,10 +357,11 @@ struct rxrpc_local *rxrpc_use_local(struct rxrpc_local *local,
357357
*/
358358
void rxrpc_unuse_local(struct rxrpc_local *local, enum rxrpc_local_trace why)
359359
{
360-
unsigned int debug_id = local->debug_id;
360+
unsigned int debug_id;
361361
int r, u;
362362

363363
if (local) {
364+
debug_id = local->debug_id;
364365
r = refcount_read(&local->ref);
365366
u = atomic_dec_return(&local->active_users);
366367
trace_rxrpc_local(debug_id, why, r, u);

0 commit comments

Comments
 (0)