lkml.org 
[lkml]   [2013]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 4/7] KEYS: split call to call_usermodehelper_fns()
On 03/08, Lucas De Marchi wrote:
>
> static int call_usermodehelper_keys(char *path, char **argv, char **envp,
> struct key *session_keyring, int wait)
> {
> - return call_usermodehelper_fns(path, argv, envp, wait,
> - umh_keys_init, umh_keys_cleanup,
> - key_get(session_keyring));
> + struct subprocess_info *info;
> +
> + info = call_usermodehelper_setup(path, argv, envp, GFP_KERNEL,
> + umh_keys_init, umh_keys_cleanup,
> + key_get(session_keyring));
> + if (!info) {
> + key_put(session_keyring);
> + return -ENOMEM;
> + }
> +
> + return call_usermodehelper_exec(info, wait);

Looks correct, but can't we simpluify it a bit?

info = call_usermodehelper_setup(session_keyring);
if (!info)
return ENOMEM;

key_get(session_keyring));
return call_usermodehelper_exec(info);

Oleg.



\
 
 \ /
  Last update: 2013-03-09 22:01    [W:0.248 / U:0.804 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site