lkml.org 
[lkml]   [2012]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v4 3/3] cred: change keyctl_session_to_parent() to use task_work_add()
Date
Oleg Nesterov <oleg@redhat.com> wrote:

> - int ret;
> + struct cred *cred;
> + int err;

There's no need to change ret to be err. It produces slightly less churn if
you don't.

> + err = -ENOMEM;
> + newwork = kmalloc(sizeof(struct task_work), GFP_KERNEL);
> + if (!newwork)
> + goto error_keyring;

This passes unnecessarily through kfree(newwork). Please add a new goto label
and go to that.

> -/*
> - * Replace a process's session keyring on behalf of one of its children when
> - * the target process is about to resume userspace execution.
> - */

Please don't delete the banner comment saying what the function does.

> -void key_replace_session_keyring(void)
> +void key_change_session_keyring(struct task_work *twork)

There's no particular need to change the name of the function.

David


\
 
 \ /
  Last update: 2012-04-17 16:25    [W:0.163 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site