Commit eaa02390 authored by David Howells's avatar David Howells Committed by David S. Miller
Browse files

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: a2cf3264 ("rxrpc: Fold __rxrpc_unuse_local() into rxrpc_unuse_local()")
Reported-by: default avatar <syzbot+3538a6a72efa8b059c38@syzkaller.appspotmail.com>
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Tested-by: default avatar <syzbot+3538a6a72efa8b059c38@syzkaller.appspotmail.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fdb99487
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -357,10 +357,11 @@ struct rxrpc_local *rxrpc_use_local(struct rxrpc_local *local,
 */
void rxrpc_unuse_local(struct rxrpc_local *local, enum rxrpc_local_trace why)
{
	unsigned int debug_id = local->debug_id;
	unsigned int debug_id;
	int r, u;

	if (local) {
		debug_id = local->debug_id;
		r = refcount_read(&local->ref);
		u = atomic_dec_return(&local->active_users);
		trace_rxrpc_local(debug_id, why, r, u);