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

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: syzbot+3538a6a72efa8b059c38@syzkaller.appspotmail.com
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Tested-by: 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
...@@ -357,10 +357,11 @@ struct rxrpc_local *rxrpc_use_local(struct rxrpc_local *local, ...@@ -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) 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; int r, u;
if (local) { if (local) {
debug_id = local->debug_id;
r = refcount_read(&local->ref); r = refcount_read(&local->ref);
u = atomic_dec_return(&local->active_users); u = atomic_dec_return(&local->active_users);
trace_rxrpc_local(debug_id, why, r, u); trace_rxrpc_local(debug_id, why, r, u);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment