linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: hello, please help me check this potential bug, thanks.
       [not found] <52C11B36.167D70.09200@tsinghua.edu.cn>
@ 2013-12-30 13:45 ` Lars-Peter Clausen
  0 siblings, 0 replies; only message in thread
From: Lars-Peter Clausen @ 2013-12-30 13:45 UTC (permalink / raw)
  To: Huqiu Liu; +Cc: yinj2010, Linux Input

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-12-30 13:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <52C11B36.167D70.09200@tsinghua.edu.cn>
2013-12-30 13:45 ` hello, please help me check this potential bug, thanks Lars-Peter Clausen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).