On Sun, Jun 27, 2010 at 7:17 PM, Andy Walls <awa...@md.metrocast.net> wrote:
>
> Jarrod,
>
> Looking at the patches branch from your WIP git tree:
>
> Is mceusb_init_input_dev() supposed to allocate a struct ir_input_dev?
> It looks like ir_register_input() handles that, and it is trashing your
> pointer (memory leak).

Eep, crap, you're right. Fixed locally (I think), will test it out and
ship off the patch probably tomorrow (exhausting weekend of watching
futbol and some heavy-duty bbq'ing, need to turn in early... ;).

Just double-checked, I actually cribbed that incorrectness from
imon.c, so I'll need to fix it there too. D'oh.

> Mauro and Jarrod,
>
> When ir_register_input() fails, it doesn't indicate whether or not it
> was able to register the input_dev or not.  To me it looks like it can
> return with failure with the input_dev either way depending on the case.
> This makes proper cleanup of the input_dev in my cx23885_input_init()
> function difficult in the failure case, since the input subsystem has
> two different deallocators depending on if the device had been
> registered or not.

Hm. I've done a double-take a few times now, but if
input_register_device is successful, and something later in
__ir_input_register fails, input_unregister_device *does* get called
within __ir_input_register, so all you should have to do is call
input_free_device in your init function's error path, no?

-- 
Jarod Wilson
ja...@wilsonet.com
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to