Re: [PATCH v2 4/7] KEYS: split call to call_usermodehelper_fns()

2013-03-25 Thread Lucas De Marchi
On Mon, Mar 25, 2013 at 9:55 AM, David Howells wrote: > Oleg Nesterov wrote: > >> Looks correct, but can't we simpluify it a bit? >> >> info = call_usermodehelper_setup(session_keyring); >> if (!info) >> return ENOMEM; > > -ENOMEM;-) Yep, it's in -mm with -ENOMEM:

Re: [PATCH v2 4/7] KEYS: split call to call_usermodehelper_fns()

2013-03-25 Thread David Howells
Oleg Nesterov wrote: > Looks correct, but can't we simpluify it a bit? > > info = call_usermodehelper_setup(session_keyring); > if (!info) > return ENOMEM; -ENOMEM;-) > key_get(session_keyring)); > return call_usermodehelper_exec(info); Looks reasonable.

Re: [PATCH v2 4/7] KEYS: split call to call_usermodehelper_fns()

2013-03-25 Thread David Howells
Oleg Nesterov o...@redhat.com wrote: Looks correct, but can't we simpluify it a bit? info = call_usermodehelper_setup(session_keyring); if (!info) return ENOMEM; -ENOMEM;-) key_get(session_keyring)); return call_usermodehelper_exec(info); Looks

Re: [PATCH v2 4/7] KEYS: split call to call_usermodehelper_fns()

2013-03-25 Thread Lucas De Marchi
On Mon, Mar 25, 2013 at 9:55 AM, David Howells dhowe...@redhat.com wrote: Oleg Nesterov o...@redhat.com wrote: Looks correct, but can't we simpluify it a bit? info = call_usermodehelper_setup(session_keyring); if (!info) return ENOMEM; -ENOMEM;-) Yep, it's in

Re: [PATCH v2 4/7] KEYS: split call to call_usermodehelper_fns()

2013-03-09 Thread Lucas De Marchi
On Sat, Mar 9, 2013 at 5:25 PM, Oleg Nesterov wrote: > 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

Re: [PATCH v2 4/7] KEYS: split call to call_usermodehelper_fns()

2013-03-09 Thread Oleg Nesterov
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, > -

Re: [PATCH v2 4/7] KEYS: split call to call_usermodehelper_fns()

2013-03-09 Thread Oleg Nesterov
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, -

Re: [PATCH v2 4/7] KEYS: split call to call_usermodehelper_fns()

2013-03-09 Thread Lucas De Marchi
On Sat, Mar 9, 2013 at 5:25 PM, Oleg Nesterov o...@redhat.com wrote: 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

[PATCH v2 4/7] KEYS: split call to call_usermodehelper_fns()

2013-03-07 Thread Lucas De Marchi
Use call_usermodehelper_setup() + call_usermodehelper_exec() instead of calling call_usermodehelper_fns(). In case there's an OOM in this last function the cleanup function may not be called - in this case we would miss a call to key_put(). Signed-off-by: Lucas De Marchi ---

[PATCH v2 4/7] KEYS: split call to call_usermodehelper_fns()

2013-03-07 Thread Lucas De Marchi
Use call_usermodehelper_setup() + call_usermodehelper_exec() instead of calling call_usermodehelper_fns(). In case there's an OOM in this last function the cleanup function may not be called - in this case we would miss a call to key_put(). Signed-off-by: Lucas De Marchi