linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Dan Carpenter <error27@gmail.com>
Cc: Jean Delvare <khali@linux-fr.org>,
	Mike Frysinger <vapier@gentoo.org>,
	Richard Purdie <rpurdie@linux.intel.com>,
	linux-input@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] input: pcf8574_keypad: use after input_unregister_device()
Date: Thu, 11 Nov 2010 01:04:23 -0800	[thread overview]
Message-ID: <20101111090423.GH24415@core.coreip.homeip.net> (raw)
In-Reply-To: <20101111062429.GA3610@bicker>

On Thu, Nov 11, 2010 at 10:28:30AM +0300, Dan Carpenter wrote:
> input_unregister_device() is tricky because it frees the argument.  So
> in the original code the call to input_set_drvdata(idev, NULL) is a use
> after free bug.  The other problem is the input_set_drvdata() makes the 
> input_free_device() into a no-op.
> 
> The prefered style in input/ is to make input_register_device() the
> last function in the probe which can fail.  That way we don't need to
> call input_unregister_device().
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Applied, thanks Dan.

-- 
Dmitry

      reply	other threads:[~2010-11-11  9:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-11  7:28 [patch] input: pcf8574_keypad: use after input_unregister_device() Dan Carpenter
2010-11-11  9:04 ` Dmitry Torokhov [this message]

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=20101111090423.GH24415@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=error27@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=khali@linux-fr.org \
    --cc=linux-input@vger.kernel.org \
    --cc=rpurdie@linux.intel.com \
    --cc=vapier@gentoo.org \
    /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;
as well as URLs for NNTP newsgroup(s).