From: David Howells Date: Thu, 20 Aug 2020 13:37:12 +0000 (+0100) Subject: afs: Fix key ref leak in afs_put_operation() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=ba8e42077bbe046a09bdb965dbfbf8c27594fe8f;p=linux.git afs: Fix key ref leak in afs_put_operation() 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 Signed-off-by: David Howells Signed-off-by: Linus Torvalds --- diff --git a/fs/afs/fs_operation.c b/fs/afs/fs_operation.c index 24fd163c6323e..97cab12b0a6c2 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; }