On 10/29/07, Dirk Hohndel <[EMAIL PROTECTED]> wrote:
>
> Actually, the more I look at the code that bails when it runs out of memory,
> the more I wonder about that.
>
>        hidinput = kzalloc(sizeof(*hidinput), GFP_KERNEL);
>        input_dev = input_allocate_device();
>        if (!hidinput || !input_dev) {
>                kfree(hidinput);
>                input_free_device(input_dev);
>
> This either passes a NULL pointer to kfree or to input_free_device. That's
> not nice.
>

No, that's allright. input_free_device() takes after kfree() so that
it safe to call it with NULL pointer.

-- 
Dmitry

Reply via email to