25 Apr
2013
25 Apr
'13
2:52 p.m.
On Wed, Apr 24, 2013 at 04:50:48PM +0300, Leon Romanovsky wrote:
On Thu, Dec 20, 2012 at 4:18 PM, Mark Brown
ret = input_register_device(wm8962->beep); if (ret != 0) {
input_free_device(wm8962->beep); wm8962->beep = NULL; dev_err(codec->dev, "Failed to register beep device\n"); }
I'm not sure if this patch is correct. According to comment of input_free_memory() (http://lxr.free-electrons.com/source/drivers/input/input.c#L1825) you need to call it if input_register_device failed.
This seems like a bug that should be fixed on the API side, it's really not what you'd expect a devm function to do, and if you are explicitly freeing a devm allocated object there's an expectation that you need to call a corresponding devm cleanup function.