From: David Howells The attached patch causes the add_key() syscall to return a different error if the key type is unavailable to distinguish between that and an error indicating the keyring to add to is unavailable. Signed-Off-By: David Howells Signed-off-by: Andrew Morton --- 25-akpm/security/keys/key.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -puN security/keys/key.c~return-a-different-error-if-unavailable-keytype-is-used security/keys/key.c --- 25/security/keys/key.c~return-a-different-error-if-unavailable-keytype-is-used Thu Sep 23 14:36:18 2004 +++ 25-akpm/security/keys/key.c Thu Sep 23 14:36:18 2004 @@ -744,7 +744,7 @@ struct key *key_create_or_update(struct * types */ ktype = key_type_lookup(type); if (IS_ERR(ktype)) { - key = ERR_PTR(PTR_ERR(ktype)); + key = ERR_PTR(-ENODEV); goto error; } _