From: Andi Kleen Date: Thu, 28 Oct 2010 12:16:13 +0000 (+0100) Subject: Fix install_process_keyring error handling X-Git-Tag: v2.6.37-rc1~71 X-Git-Url: https://bbs.cooldavid.org/git/?p=net-next-2.6.git;a=commitdiff_plain;h=27d6379894be4a81984da4d48002196a83939ca9 Fix install_process_keyring error handling Fix an incorrect error check that returns 1 for error instead of the expected error code. Signed-off-by: Andi Kleen Signed-off-by: David Howells Signed-off-by: Linus Torvalds --- diff --git a/security/keys/process_keys.c b/security/keys/process_keys.c index f8e7251ae2c..504bdd2452b 100644 --- a/security/keys/process_keys.c +++ b/security/keys/process_keys.c @@ -207,7 +207,7 @@ static int install_process_keyring(void) ret = install_process_keyring_to_cred(new); if (ret < 0) { abort_creds(new); - return ret != -EEXIST ?: 0; + return ret != -EEXIST ? ret : 0; } return commit_creds(new);