From 7c8ab4fee291c37b93b942dba64b942d35377a8f Mon Sep 17 00:00:00 2001 From: David Howells Date: Tue, 21 Jun 2011 14:32:05 +0100 Subject: [PATCH] --- yaml --- r: 253948 b: refs/heads/master c: b1d7dd80aadb9042e83f9778b484a2f92e0b04d4 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/security/keys/request_key.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 627960f960ee..adef530de2ff 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 35052cffe0081904f3362c05818db900dd9dc7de +refs/heads/master: b1d7dd80aadb9042e83f9778b484a2f92e0b04d4 diff --git a/trunk/security/keys/request_key.c b/trunk/security/keys/request_key.c index 8e319a416eec..82465328c39b 100644 --- a/trunk/security/keys/request_key.c +++ b/trunk/security/keys/request_key.c @@ -469,7 +469,7 @@ static struct key *construct_key_and_link(struct key_type *type, } else if (ret == -EINPROGRESS) { ret = 0; } else { - key = ERR_PTR(ret); + goto couldnt_alloc_key; } key_put(dest_keyring); @@ -479,6 +479,7 @@ static struct key *construct_key_and_link(struct key_type *type, construction_failed: key_negate_and_link(key, key_negative_timeout, NULL, NULL); key_put(key); +couldnt_alloc_key: key_put(dest_keyring); kleave(" = %d", ret); return ERR_PTR(ret);