From 881f85578ab4a7c02375bcfc10026ad1a0800cdb Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 5 May 2009 11:02:20 +1000 Subject: If QueryHardware failed, return that failure and clean up. Signed-off-by: Peter Hutterer Signed-off-by: Christoph Brill Signed-off-by: Henrik Rydberg (cherry picked from commit a9a443959585e7f65ba3f300d387cf617d9df77b) Conflicts: src/synaptics.c --- src/synaptics.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/synaptics.c b/src/synaptics.c index 9b89595..710c786 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -729,7 +729,15 @@ DeviceOn(DeviceIntPtr dev) xf86FlushInput(local->fd); /* reinit the pad */ - QueryHardware(local); + if (!QueryHardware(local)) + { + XisbFree(priv->comm.buffer); + priv->comm.buffer = NULL; + xf86CloseSerial(local->fd); + local->fd = -1; + return !Success; + } + xf86AddEnabledDevice(local); dev->public.on = TRUE; @@ -2204,6 +2212,7 @@ QueryHardware(LocalDevicePtr local) } else { xf86Msg(X_PROBED, "%s: no supported touchpad found\n", local->name); priv->proto_ops->DeviceOffHook(local); + return FALSE; } return TRUE; -- cgit v1.2.3