The patch titled Subject: kernel/auditsc.c: use kzalloc instead of kmalloc+memset has been added to the -mm tree. Its filename is auditsc-use-kzalloc-instead-of-kmallocmemset.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Rakib Mullick <rakib.mullick@xxxxxxxxx> Subject: kernel/auditsc.c: use kzalloc instead of kmalloc+memset In audit_alloc_context() use kzalloc instead of kmalloc+memset. Also rename audit_zero_context() to audit_set_context(), to represent it's inner workings properly. Signed-off-by: Rakib Mullick <rakib.mullick@xxxxxxxxx> Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx> Cc: Eric Paris <eparis@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/auditsc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff -puN kernel/auditsc.c~auditsc-use-kzalloc-instead-of-kmallocmemset kernel/auditsc.c --- a/kernel/auditsc.c~auditsc-use-kzalloc-instead-of-kmallocmemset +++ a/kernel/auditsc.c @@ -1034,10 +1034,9 @@ static inline void audit_free_aux(struct } } -static inline void audit_zero_context(struct audit_context *context, +static inline void audit_set_context(struct audit_context *context, enum audit_state state) { - memset(context, 0, sizeof(*context)); context->state = state; context->prio = state == AUDIT_RECORD_CONTEXT ? ~0ULL : 0; } @@ -1046,9 +1045,10 @@ static inline struct audit_context *audi { struct audit_context *context; - if (!(context = kmalloc(sizeof(*context), GFP_KERNEL))) + context = kzalloc(sizeof(*context), GFP_KERNEL); + if (!context) return NULL; - audit_zero_context(context, state); + audit_set_context(context, state); INIT_LIST_HEAD(&context->killed_trees); INIT_LIST_HEAD(&context->names_list); return context; _ Patches currently in -mm which might be from rakib.mullick@xxxxxxxxx are auditsc-use-kzalloc-instead-of-kmallocmemset.patch auditsc-use-kzalloc-instead-of-kmallocmemset-fix.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html