keys: PTR_ERR return of wrong pointer in keyctl_get_security()
authorRoel Kluin <roel.kluin@gmail.com>
Tue, 15 Dec 2009 23:05:12 +0000 (15:05 -0800)
committerJames Morris <jmorris@namei.org>
Wed, 16 Dec 2009 22:23:48 +0000 (09:23 +1100)
Return the PTR_ERR of the correct pointer.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
security/keys/keyctl.c

index 06ec722..5f830bc 100644 (file)
@@ -1194,7 +1194,7 @@ long keyctl_get_security(key_serial_t keyid,
                 * have the authorisation token handy */
                instkey = key_get_instantiation_authkey(keyid);
                if (IS_ERR(instkey))
-                       return PTR_ERR(key_ref);
+                       return PTR_ERR(instkey);
                key_put(instkey);
 
                key_ref = lookup_user_key(keyid, KEY_LOOKUP_PARTIAL, 0);