login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
August
»
31
Re: [PATCH 1/6 v2] HID: magicmouse: don't allow hidinput to initialize the device
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Michael Poole
Subject:
Re: [PATCH 1/6 v2] HID: magicmouse: don't allow hidinput to initialize the device
Date: Tuesday, August 31, 2010 - 4:45 pm
On Tue, 2010-08-31 at 14:41 -0400, Chase Douglas wrote:
quoted text
> From: Chase Douglas <chase.douglas@ubuntu.com> > > The driver listens only for raw events from the device. If we allow > the hidinput layer to initialize, we can hit NULL pointer dereferences > in the hidinput layer because disconnecting only removes the hidinput > devices from the hid device while leaving the hid fields configured. > > Signed-off-by: Chase Douglas <chase.douglas@canonical.com> > --- > Note that this mimics what the hid-picolcd module does.
Thanks, this approach makes sense to me. Acked-by: Michael Poole <mdpoole@troilus.org>
quoted text
> drivers/hid/hid-magicmouse.c | 13 +++++++++---- > 1 files changed, 9 insertions(+), 4 deletions(-) > > diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c > index 319b0e5..d38b529 100644 > --- a/drivers/hid/hid-magicmouse.c > +++ b/drivers/hid/hid-magicmouse.c > @@ -404,15 +404,20 @@ static int magicmouse_probe(struct hid_device *hdev, > goto err_free; > } > > - ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); > + /* When registering a hid device, one of hidinput, hidraw, or hiddev > + * subsystems must claim the device. We are bypassing hidinput due to > + * our raw event processing, and hidraw and hiddev may not claim the > + * device. We get around this by telling hid_hw_start that input has > + * claimed the device already, and then flipping the bit back. > + */ > + hdev->claimed = HID_CLAIMED_INPUT; > + ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_HIDINPUT); > + hdev->claimed &= ~HID_CLAIMED_INPUT; > if (ret) { > dev_err(&hdev->dev, "magicmouse hw start failed\n"); > goto err_free; > } > > - /* we are handling the input ourselves */ > - hidinput_disconnect(hdev); > - > report = hid_register_report(hdev, HID_INPUT_REPORT, TOUCH_REPORT_ID); > if (!report) { > dev_err(&hdev->dev, "unable to register touch report\n");
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH 1/6 v2] HID: magicmouse: don't allow hidinput to in ...
, Chase Douglas
, (Tue Aug 31, 11:41 am)
[PATCH 2/6 v2] HID: magicmouse: move features reports to s ...
, Chase Douglas
, (Tue Aug 31, 11:41 am)
[PATCH 3/6 v2] HID: magicmouse: simplify touch data bit ma ...
, Chase Douglas
, (Tue Aug 31, 11:41 am)
[PATCH 4/6 v2] HID: magicmouse: remove axis data filtering
, Chase Douglas
, (Tue Aug 31, 11:41 am)
[PATCH 5/6 v2] HID: magicmouse: enable Magic Trackpad support
, Chase Douglas
, (Tue Aug 31, 11:41 am)
[PATCH 6/6 v2] HID: magicmouse: Adjust major / minor axes ...
, Chase Douglas
, (Tue Aug 31, 11:41 am)
Re: [PATCH 4/6 v2] HID: magicmouse: remove axis data filtering
, Henrik Rydberg
, (Tue Aug 31, 1:34 pm)
Re: [PATCH 4/6 v2] HID: magicmouse: remove axis data filtering
, Chase Douglas
, (Tue Aug 31, 1:58 pm)
Re: [PATCH 4/6 v2] HID: magicmouse: remove axis data filtering
, Henrik Rydberg
, (Tue Aug 31, 2:06 pm)
Re: [PATCH 4/6 v2] HID: magicmouse: remove axis data filtering
, Chase Douglas
, (Tue Aug 31, 2:16 pm)
Re: [PATCH 4/6 v2] HID: magicmouse: remove axis data filtering
, Henrik Rydberg
, (Tue Aug 31, 2:18 pm)
Re: [PATCH 4/6 v2] HID: magicmouse: remove axis data filtering
, Chase Douglas
, (Tue Aug 31, 2:27 pm)
Re: [PATCH 4/6 v2] HID: magicmouse: remove axis data filtering
, Henrik Rydberg
, (Tue Aug 31, 2:39 pm)
Re: [PATCH 4/6 v2] HID: magicmouse: remove axis data filtering
, Chase Douglas
, (Tue Aug 31, 2:51 pm)
Re: [PATCH 4/6 v2] HID: magicmouse: remove axis data filtering
, Chase Douglas
, (Tue Aug 31, 2:56 pm)
Re: [PATCH 5/6 v2] HID: magicmouse: enable Magic Trackpad ...
, Henrik Rydberg
, (Tue Aug 31, 3:00 pm)
Re: [PATCH 4/6 v2] HID: magicmouse: remove axis data filtering
, Henrik Rydberg
, (Tue Aug 31, 3:05 pm)
Re: [PATCH 4/6 v2] HID: magicmouse: remove axis data filtering
, Chase Douglas
, (Tue Aug 31, 3:29 pm)
Re: [PATCH 1/6 v2] HID: magicmouse: don't allow hidinput t ...
, Michael Poole
, (Tue Aug 31, 4:45 pm)
Re: [PATCH 5/6 v2] HID: magicmouse: enable Magic Trackpad ...
, Michael Poole
, (Tue Aug 31, 5:08 pm)
Re: [PATCH 5/6 v2] HID: magicmouse: enable Magic Trackpad ...
, Chase Douglas
, (Tue Aug 31, 6:26 pm)
Re: [PATCH 5/6 v2] HID: magicmouse: enable Magic Trackpad ...
, Chase Douglas
, (Tue Aug 31, 6:55 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Ken Chen
[patch] sched: fix inconsistency when redistribute per-cpu tg->cfs_rq shares.
Ingo Molnar
Re: [PATCH v3] x86: merge the simple bitops and move them to bitops.h
Paul Turner
[tg_shares_up rewrite v4 11/11] sched: update tg->shares after cpu.shares write
Andi Kleen
Re: - romsignature-checksum-cleanup-2.patch removed from -mm tree
Stefano Stabellini
Re: [PATCH 09/22] xen: Find an unbound irq number in reverse order (high to low).
git
:
Junio C Hamano
Re: Teach "git checkout" to use git-show-ref
Christian Jaeger
Re: Problem with Git.pm bidi_pipe methods
Linus Torvalds
[PATCH 1/7] Make unpack_trees_options bit flags actual bitfields
Jon Smirl
stgit: managing signed-off-by lines
Junio C Hamano
GIT 1.4.3-rc2
git-commits-head
:
Linux Kernel Mailing List
MIPS: Bonito64: Make Loongson independent from Bonito64 code.
Linux Kernel Mailing List
iwlwifi: initialize spinlock before use
Linux Kernel Mailing List
i2c-i801: Add Intel Cougar Point device IDs
Linux Kernel Mailing List
drm/i915: Add information on pinning and fencing to the i915 list debug.
Linux Kernel Mailing List
cirrusfb: GD5434 (aka SD64) support fixed
linux-netdev
:
Gerrit Renker
v2 [PATCH 1/4] dccp: Limit feature negotiation to connection setup phase
Richard Cochran
Re: [PATCH v3 3/3] ptp: Added a clock that uses the eTSEC found on the MPC85xx.
Inaky Perez-Gonzalez
[PATCH 40/40] wimax/i2400m: add CREDITS and MAINTAINERS entries
Sathya Perla
[PATCH net-next-2.6] be2net: add multiple RX queue support
Changli Gao
Re: [PATCH 3/3] ifb: move tq from ifb_private
freebsd-current
:
Boris Samorodov
Re: twa + dump = sbwait
韓家標 Bill Hacker
Re: ZFS honesty
Bjoern A. Zeeb
Re: Can not boot 7.0-BETA3 with IPSEC
rmgls
man usb2_core(4)
Sam Leffler
Re: Lots of "ath0: bad series0 hwrate 0x1b" in 8.0-BETA2
Colocation donated by:
Syndicate