[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMOw1v5OHc9EmS3WENQStu8W=Q2_+K1o=khru8sQmMUNQjU8cA@mail.gmail.com>
Date: Sat, 9 Mar 2013 20:55:37 -0300
From: Lucas De Marchi <lucas.demarchi@...fusion.mobi>
To: Oleg Nesterov <oleg@...hat.com>
Cc: lucas.de.marchi@...il.com, David Howells <dhowells@...hat.com>,
James Morris <james.l.morris@...cle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 4/7] KEYS: split call to call_usermodehelper_fns()
On Sat, Mar 9, 2013 at 5:25 PM, Oleg Nesterov <oleg@...hat.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 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);
Yep, looks better this way.
Lucas De Marchi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists