From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: nick.dyer@itdev.co.uk
Cc: Yufeng Shen <miletus@google.com>,
Daniel Kurtz <djkurtz@chromium.org>,
Henrik Rydberg <rydberg@euromail.se>,
Joonyoung Shim <jy0922.shim@samsung.com>,
Alan Bowens <Alan.Bowens@atmel.com>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
Peter Meerwald <pmeerw@pmeerw.net>,
Benson Leung <bleung@chromium.org>,
Olof Johansson <olofj@chromium.org>, Sekhar Nori <nsekhar@ti.com>,
Stephen Warren <swarren@wwwdotorg.org>
Subject: Re: [PATCH 1/2] Input: atmel_mxt_ts - Fix double free of input device
Date: Thu, 7 Aug 2014 09:55:45 -0700 [thread overview]
Message-ID: <20140807165545.GB22421@core.coreip.homeip.net> (raw)
In-Reply-To: <1407420438-6289-2-git-send-email-nick.dyer@itdev.co.uk>
On Thu, Aug 07, 2014 at 03:07:17PM +0100, nick.dyer@itdev.co.uk wrote:
> From: Stephen Warren <swarren@wwwdotorg.org>
>
> Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
> ---
> drivers/input/touchscreen/atmel_mxt_ts.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
> index 03b8571..da497db 100644
> --- a/drivers/input/touchscreen/atmel_mxt_ts.c
> +++ b/drivers/input/touchscreen/atmel_mxt_ts.c
> @@ -1353,8 +1353,10 @@ static int mxt_get_info(struct mxt_data *data)
>
> static void mxt_free_object_table(struct mxt_data *data)
> {
> - input_unregister_device(data->input_dev);
> - data->input_dev = NULL;
> + if (data->input_dev) {
> + input_unregister_device(data->input_dev);
> + data->input_dev = NULL;
> + }
>
> kfree(data->object_table);
> data->object_table = NULL;
> @@ -2194,7 +2196,6 @@ static int mxt_remove(struct i2c_client *client)
>
> sysfs_remove_group(&client->dev.kobj, &mxt_attr_group);
> free_irq(data->irq, data);
> - input_unregister_device(data->input_dev);
> mxt_free_object_table(data);
> kfree(data);
No. Let's have mxt_free_object_table() only free object table, and let's
call input_unregister_device() explicitly where needed, like we do in
mxt_remove().
Thanks.
--
Dmitry
next prev parent reply other threads:[~2014-08-07 16:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-07 14:07 Minor fixes for atmel_mxt_ts nick.dyer
2014-08-07 14:07 ` [PATCH 1/2] Input: atmel_mxt_ts - Fix double free of input device nick.dyer
2014-08-07 16:55 ` Dmitry Torokhov [this message]
2014-08-07 14:07 ` [PATCH 2/2] Input: atmel_mxt_ts - mXT224 DMA quirk was fixed in firmware v2.0.AA nick.dyer
2014-08-26 20:10 ` Benson Leung
2014-08-07 16:59 ` Minor fixes for atmel_mxt_ts Dmitry Torokhov
2014-08-08 15:58 ` nick.dyer
2014-08-08 15:58 ` [PATCH 1/2] Input: atmel_mxt_ts - simplify mxt_initialize a bit nick.dyer
2014-08-08 16:19 ` Dmitry Torokhov
2014-08-08 16:19 ` Dmitry Torokhov
2014-08-08 15:58 ` [PATCH 2/2] Input: atmel_mxt_ts - split config update " nick.dyer
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=20140807165545.GB22421@core.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=Alan.Bowens@atmel.com \
--cc=bleung@chromium.org \
--cc=djkurtz@chromium.org \
--cc=jy0922.shim@samsung.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miletus@google.com \
--cc=nick.dyer@itdev.co.uk \
--cc=nsekhar@ti.com \
--cc=olofj@chromium.org \
--cc=pmeerw@pmeerw.net \
--cc=rydberg@euromail.se \
--cc=swarren@wwwdotorg.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
all inboxes | Powered by JetHome®