]> git.baikalelectronics.ru Git - kernel.git/commit
Staging: ste_rmi4: use after input_unregister_device()
authorDan Carpenter <error27@gmail.com>
Wed, 22 Dec 2010 21:07:33 +0000 (00:07 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 20 Jan 2011 20:01:23 +0000 (12:01 -0800)
commit0b7a5a683ec9ba4dd02781c7a4989ded40f4b1e3
tree068439c3b12599a5ad9ec0ab08db88683ea0d0ad
parent06d16616eee8fc5d8afc9a83c924c41ca1d96ac1
Staging: ste_rmi4: use after input_unregister_device()

The original code called input_free_device(rmi4_data->input_dev) after
input_unregister_device(rmi4_data->input_dev) and that's a double free.
This is described in the comments to input_unregister_device().

The normal way to handle this is to make input_register_device() the
last function in the probe which can fail.  That way you can avoid the
call to input_unregister_device() entirely.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c