diff options
-rw-r--r-- | security/keys/request_key.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/security/keys/request_key.c b/security/keys/request_key.c index 8e319a416eec..82465328c39b 100644 --- a/security/keys/request_key.c +++ b/security/keys/request_key.c | |||
@@ -469,7 +469,7 @@ static struct key *construct_key_and_link(struct key_type *type, | |||
469 | } else if (ret == -EINPROGRESS) { | 469 | } else if (ret == -EINPROGRESS) { |
470 | ret = 0; | 470 | ret = 0; |
471 | } else { | 471 | } else { |
472 | key = ERR_PTR(ret); | 472 | goto couldnt_alloc_key; |
473 | } | 473 | } |
474 | 474 | ||
475 | key_put(dest_keyring); | 475 | key_put(dest_keyring); |
@@ -479,6 +479,7 @@ static struct key *construct_key_and_link(struct key_type *type, | |||
479 | construction_failed: | 479 | construction_failed: |
480 | key_negate_and_link(key, key_negative_timeout, NULL, NULL); | 480 | key_negate_and_link(key, key_negative_timeout, NULL, NULL); |
481 | key_put(key); | 481 | key_put(key); |
482 | couldnt_alloc_key: | ||
482 | key_put(dest_keyring); | 483 | key_put(dest_keyring); |
483 | kleave(" = %d", ret); | 484 | kleave(" = %d", ret); |
484 | return ERR_PTR(ret); | 485 | return ERR_PTR(ret); |