public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Walls <awalls@md.metrocast.net>
To: Jarod Wilson <jarod@wilsonet.com>
Cc: "Mauro Carvalho Chehab" <mchehab@redhat.com>,
	"David Härdeman" <david@hardeman.nu>,
	linux-media@vger.kernel.org
Subject: MCEUSB memory leak and how to tell if ir_register_input() failure registered input_dev?
Date: Sun, 27 Jun 2010 19:17:25 -0400	[thread overview]
Message-ID: <1277680645.3347.7.camel@localhost> (raw)
In-Reply-To: <AANLkTimDJAyvowo_1bLhKPhlDWzzMeF87or4MriJ_UT8@mail.gmail.com>


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).

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.

Regards,
Andy



  parent reply	other threads:[~2010-06-27 23:17 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-07 19:32 [PATCH 0/8] rc-core cleanups David Härdeman
2010-06-07 19:32 ` [PATCH 1/8] ir-core: convert mantis to not use ir-functions.c David Härdeman
2010-06-07 19:32 ` [PATCH 2/8] ir-core: convert em28xx " David Härdeman
2010-06-27 10:23   ` Mauro Carvalho Chehab
2010-06-27 11:19     ` Mauro Carvalho Chehab
2010-06-07 19:32 ` [PATCH 3/8] ir-core: partially convert cx88 " David Härdeman
2010-06-07 19:32 ` [PATCH 4/8] ir-core: partially convert ir-kbd-i2c.c " David Härdeman
2010-06-07 19:32 ` [PATCH 5/8] ir-core: partially convert bt8xx " David Härdeman
2010-06-27 12:11   ` Mauro Carvalho Chehab
2010-06-27 15:14     ` Andy Walls
2010-06-28  1:26       ` Mauro Carvalho Chehab
2010-06-27 20:17     ` Jarod Wilson
2010-06-27 21:37       ` Andy Walls
2010-06-27 23:17       ` Andy Walls [this message]
2010-06-28  3:34         ` MCEUSB memory leak and how to tell if ir_register_input() failure registered input_dev? Jarod Wilson
2010-07-03 13:20           ` Andy Walls
2010-06-07 19:32 ` [PATCH 6/8] ir-core: centralize sysfs raw decoder enabling/disabling David Härdeman
2010-06-07 19:32 ` [PATCH 7/8] ir-core: move decoding state to ir_raw_event_ctrl David Härdeman
2010-06-07 19:32 ` [PATCH 8/8] ir-core: merge rc-map.h into ir-core.h David Härdeman
2010-06-28 17:45   ` Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1277680645.3347.7.camel@localhost \
    --to=awalls@md.metrocast.net \
    --cc=david@hardeman.nu \
    --cc=jarod@wilsonet.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox