]> git.baikalelectronics.ru Git - kernel.git/commit
KEYS: remove unnecessary get/put of explicit dest_keyring
authorEric Biggers <ebiggers@google.com>
Fri, 8 Dec 2017 15:13:27 +0000 (15:13 +0000)
committerDavid Howells <dhowells@redhat.com>
Fri, 8 Dec 2017 15:13:27 +0000 (15:13 +0000)
commit05b04538cd68942be77de51a21134b88e5ca7f9a
treee1a015e62fcb62ea4b6c1a3993e0dcbf415cffc5
parent1c5843d19fe4a6744e18646c5f7df62246dbc4af
KEYS: remove unnecessary get/put of explicit dest_keyring

In request_key_and_link(), in the case where the dest_keyring was
explicitly specified, there is no need to get another reference to
dest_keyring before calling key_link(), then drop it afterwards.  This
is because by definition, we already have a reference to dest_keyring.

This change is useful because we'll be making
construct_get_dest_keyring() able to return an error code, and we don't
want to have to handle that error here for no reason.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: David Howells <dhowells@redhat.com>
security/keys/request_key.c