[PATCH synaptics] Free mtdev device as well as closing it

Peter Hutterer peter.hutterer at who-t.net
Tue Jan 1 21:14:39 PST 2013


On Sat, Dec 29, 2012 at 08:01:05AM -0600, Dan Nicholson wrote:
> On Fri, Dec 28, 2012 at 9:24 PM, Daniel Stone <daniel at fooishbar.org> wrote:
> > mtdev_close_delete() is to mtdev_new_open() as mtdev_close() is to
> > mtdev_open().  So, since we're using mtdev_new_open(), we need to use
> > mtdev_close_delete() instead of just mtdev_close() to actually free
> > everything.
> >
> > Fixes an eventual failure to open the touchpad device after a lot of
> > suspend/resume cycles.
> >
> > Signed-off-by: Daniel Stone <daniel at fooishbar.org>
> > ---
> >  src/eventcomm.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/src/eventcomm.c b/src/eventcomm.c
> > index b1d5460..8508e6a 100644
> > --- a/src/eventcomm.c
> > +++ b/src/eventcomm.c
> > @@ -122,7 +122,7 @@ UninitializeTouch(InputInfoPtr pInfo)
> >          proto_data->last_mt_vals = NULL;
> >      }
> >
> > -    mtdev_close(proto_data->mtdev);
> > +    mtdev_close_delete(proto_data->mtdev);
> >      proto_data->mtdev = NULL;
> >      proto_data->num_touches = 0;
> >  }
> 
> From what I can tell, evdev_query_touch() has the same imbalanced
> mtdev_new_open/mtdev_close imbalance. With that fix, too,
> 
> Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>

applied with Dan's suggestion squashed in. thanks

Cheers,
   Peter



More information about the xorg-devel mailing list