summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2020-08-20 16:37:12 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-08-26 12:49:16 +0300
commit19881ebab34ff8e0f75006df385a87d8c9e84a79 (patch)
treef1a615dd76561ce669a9997c5f28acb682754104
parentf35bb8426115fca030a3b81fc8b32608a9fe904a (diff)
downloadlinux-19881ebab34ff8e0f75006df385a87d8c9e84a79.tar.xz
afs: Fix key ref leak in afs_put_operation()
[ Upstream commit ba8e42077bbe046a09bdb965dbfbf8c27594fe8f ] The afs_put_operation() function needs to put the reference to the key that's authenticating the operation. Fixes: e49c7b2f6de7 ("afs: Build an abstraction around an "operation" concept") Reported-by: Dave Botsch <botsch@cnf.cornell.edu> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--fs/afs/fs_operation.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/afs/fs_operation.c b/fs/afs/fs_operation.c
index 24fd163c6323..97cab12b0a6c 100644
--- a/fs/afs/fs_operation.c
+++ b/fs/afs/fs_operation.c
@@ -235,6 +235,7 @@ int afs_put_operation(struct afs_operation *op)
afs_end_cursor(&op->ac);
afs_put_serverlist(op->net, op->server_list);
afs_put_volume(op->net, op->volume, afs_volume_trace_put_put_op);
+ key_put(op->key);
kfree(op);
return ret;
}