[PATCH xserver] xfree86: fix unbalanced input_lock/unlock in xf86NewInputDevice()

Peter Hutterer peter.hutterer at who-t.net
Fri Aug 12 04:44:40 UTC 2016


On Thu, Aug 11, 2016 at 09:27:29PM -0700, Keith Packard wrote:
> Peter Hutterer <peter.hutterer at who-t.net> writes:
> 
> > diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
> > index 42d0f32..054eb3e 100644
> > --- a/hw/xfree86/common/xf86Xinput.c
> > +++ b/hw/xfree86/common/xf86Xinput.c
> > @@ -961,6 +961,7 @@ xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable)
> >              xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", pInfo->name);
> >              RemoveDevice(dev, TRUE);
> >              rval = BadMatch;
> > +            input_unlock();
> >              goto unwind;
> >          }
> >          /* send enter/leave event, update sprite window */
> > -- 
> > 2.7.4
> >
> 
> The remaining OsReleaseSignals call should have been a clue. That should
> be removed in this same patch. I think we could put the input_unlock right where
> the OsReleaseSignals call is, but it is safer to place it where you
> have.
> 
> With the call to OsReleaseSignals removed, this is
> 
> Reviewed-by: Keith Packard <keithp at keithp.com>

I added a comment on why input_unlock() is later than OsReleaseSignals() and
pushed. thanks for the review.

Cheers,
   Peter





More information about the xorg-devel mailing list