* [PATCH] keys: change member variable name
@ 2015-10-15 21:43 Insu Yun
2015-10-15 21:58 ` David Howells
0 siblings, 1 reply; 2+ messages in thread
From: Insu Yun @ 2015-10-15 21:43 UTC (permalink / raw)
To: dhowells, james.l.morris, serge, keyrings, linux-security-module,
linux-kernel
Cc: taesoo, yeongjin.jang, insu, Insu Yun
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>
---
security/keys/key.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/keys/key.c b/security/keys/key.c
index aee2ec5..c047846 100644
--- a/security/keys/key.c
+++ b/security/keys/key.c
@@ -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);
--
1.9.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] keys: change member variable name
2015-10-15 21:43 [PATCH] keys: change member variable name Insu Yun
@ 2015-10-15 21:58 ` David Howells
0 siblings, 0 replies; 2+ messages in thread
From: David Howells @ 2015-10-15 21:58 UTC (permalink / raw)
To: Insu Yun
Cc: dhowells, james.l.morris, serge, keyrings, linux-security-module,
linux-kernel, taesoo, yeongjin.jang, insu
Insu Yun <wuninsu@gmail.com> wrote:
> 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>
I've applied this, but I've changed the subject line to:
keys: Be more consistent in selection of union members used
if you're okay with that.
David
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-15 21:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-15 21:43 [PATCH] keys: change member variable name Insu Yun
2015-10-15 21:58 ` David Howells
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®