keys: Be more consistent in selection of union members used
authorInsu Yun <wuninsu@gmail.com>
Wed, 21 Oct 2015 13:04:47 +0000 (14:04 +0100)
committerDavid Howells <dhowells@redhat.com>
Wed, 21 Oct 2015 14:18:35 +0000 (15:18 +0100)
key->description and key->index_key.description are same because
they are unioned. But, for readability, using same name for
duplication and validation seems better.

Signed-off-by: Insu Yun <wuninsu@gmail.com>
Signed-off-by: David Howells <dhowells@redhat.com>
security/keys/key.c

index aee2ec5a18fcafc02e5e9088b9b55b9276bbcdd9..c0478465d1ac2db54c90563ea3a09d35836fa86e 100644 (file)
@@ -278,7 +278,7 @@ struct key *key_alloc(struct key_type *type, const char *desc,
 
        key->index_key.desc_len = desclen;
        key->index_key.description = kmemdup(desc, desclen + 1, GFP_KERNEL);
-       if (!key->description)
+       if (!key->index_key.description)
                goto no_memory_3;
 
        atomic_set(&key->usage, 1);