[PATCH] dix: fix crash when removing devices on a buttonless MD pointer (#29669)
Peter Hutterer
peter.hutterer at who-t.net
Mon Aug 23 21:08:57 PDT 2010
On Mon, Aug 23, 2010 at 12:54:34AM -0700, Keith Packard wrote:
> On Mon, 23 Aug 2010 13:29:50 +1000, Peter Hutterer <peter.hutterer at who-t.net> wrote:
> > If the master does not have a button class, recalculating the number of
> > buttons required for this master dereferences a NULL pointer. Guard against
> > this, if the master pointer doesn't have a button class, it doesn't need to
> > update it's number of buttons.
>
> Don't you still need to send the event though?
No, the event is only sent when the number of buttons on the master
changes. If it doesn't change (i.e. because the master stays on "no button
class") then there's no need for the event.
Note that this isn't the usual DeviceChangedEvent path that's triggered when
the master updates itself from the slave. This path is triggered when a
slave disappears and the master may need to re-adjust the number of buttons.
If the number of buttons stay the same, no event is needed.
Cheers,
Peter
More information about the xorg-devel
mailing list