Added linux-input to Cc On 12/30/2013 08:05 AM, Huqiu Liu wrote:
Dear Lars-Peter Clausen, I'm very sorry to trouble you. Recently I checked lots of drivers and found the following potential bug: 1) In the file _/drivers\input\misc\pwm-beeper.c/_, the function *input_allocate_device * is called by the function *pwm_beeper_probe*. While the function *pwm_beeper_remove * does not call the function *input_free_device * to release the acquired resources when removing the device. Generelly the function *input_free_device * and *input_allocate_device * should be used in pairs, and more than *109 * drivers have called the function *input_free_device * to release the resources which are acquired by the function *input_allocate_device*. The acqured resources are ignored to be released when removing the device, which would cause memory leaks and other potential problems. Could you help me to check or confirm this bug please? Thank you very much. I'm looking forward to your reply.
I think the code is corect. See the input_allocate_device() documentation: * input_allocate_device - allocate memory for new input device * * Returns prepared struct input_dev or %NULL. * * NOTE: Use input_free_device() to free devices that have not been * registered; input_unregister_device() should be used for already * registered devices. - Lars -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html