linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Cc: Jiri Kosina <jkosina@suse.cz>,
	Stephane Chatty <chatty@lii-enac.fr>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hidinput: kernel oops in out_cleanup in function hidinput_connect
Date: Tue, 15 Feb 2011 08:46:14 -0800	[thread overview]
Message-ID: <20110215164614.GA18862@core.coreip.homeip.net> (raw)
In-Reply-To: <1297780870-4006-1-git-send-email-benjamin.tissoires@enac.fr>

On Tue, Feb 15, 2011 at 03:41:10PM +0100, Benjamin Tissoires wrote:
> Goto out_cleanup infers a kernel oops: hidinput_disconnect calls
> input_unregister_driver to all members of hid->inputs.
> However, hidinput already has been added to hid->inputs even
> though input_register_device was not called.
> 
> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>

Yep, well spotted.

Reviewed-by: Dmitry Torokhov <dtor@mail.ru>

> ---
> Hi,
> 
> while playing with hidinput_connect, I found this bug.
> 
> Cheers,
> Benjamin
> 
>  drivers/hid/hid-input.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
> index 7f552bf..f53911d 100644
> --- a/drivers/hid/hid-input.c
> +++ b/drivers/hid/hid-input.c
> @@ -928,6 +928,7 @@ int hidinput_connect(struct hid_device *hid, unsigned int force)
>  	return 0;
>  
>  out_cleanup:
> +	list_del(&hidinput->list);
>  	input_free_device(hidinput->input);
>  	kfree(hidinput);
>  out_unwind:
> -- 
> 1.7.4
> 

-- 
Dmitry

  reply	other threads:[~2011-02-15 16:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-15 14:41 [PATCH] hidinput: kernel oops in out_cleanup in function hidinput_connect Benjamin Tissoires
2011-02-15 16:46 ` Dmitry Torokhov [this message]
2011-02-15 22:48   ` Jiri Kosina

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=20110215164614.GA18862@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=benjamin.tissoires@enac.fr \
    --cc=chatty@lii-enac.fr \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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).