Re: [PATCH] INPUT: fix hidinput_connect ignoring retval from input_register_device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 29 Oct 2007, Dirk Hohndel wrote:

> 	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.

Actually both of the cases are fine -- it is valid to pass NULL pointer to 
kfree() and to input_free_device() too.

> Would something like this work?

Yes, I think that this patch is in principle fine, modulo the redundant 
NULL-ptr checks.

Thanks,

-- 
Jiri Kosina
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux