diff options
-rw-r--r-- | security/selinux/ss/conditional.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/security/selinux/ss/conditional.c b/security/selinux/ss/conditional.c index 05c7a10e0aab..0b32f3ab025e 100644 --- a/security/selinux/ss/conditional.c +++ b/security/selinux/ss/conditional.c @@ -686,12 +686,11 @@ static int cond_bools_copy(struct hashtab_node *new, struct hashtab_node *orig, { struct cond_bool_datum *datum; - datum = kmalloc(sizeof(struct cond_bool_datum), GFP_KERNEL); + datum = kmemdup(orig->datum, sizeof(struct cond_bool_datum), + GFP_KERNEL); if (!datum) return -ENOMEM; - memcpy(datum, orig->datum, sizeof(struct cond_bool_datum)); - new->key = orig->key; /* No need to copy, never modified */ new->datum = datum; return 0; |