Re: [PATCH] usermodehelper: Fix -ENOMEM return logic

Oleg Nesterov
2013-02-25T16:53:17Z

On 02/25, David Howells wrote:
>
> Lucas De Marchi <lucas.demarchi@profusion.mobi> wrote:
>
> > This patch fixes both call_usermodehelper_fns() to never call the
> > cleanup function in case retval == -ENOMEM and also the callers to
> > actually check the return value of this function.
>
> I suspect it's probably better to always call the cleanup function from
> call_usermodehelper_fns() rather than have the cleanup done by the caller in
> some circumstances and not others - would it make sense to change the cleanup
> function to take the pointer to the caller data rather than to take the
> subprocess_info struct?

I this this will comlicate the logic even more, the "caller data"
has to be kmalloced/kfreed as well.

Btw. __orderly_poweroff() doesn't need any tricks, afaics. I'll send
a simple cleanup in a minute.

Oleg.