summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/synaptics.c11
1 files changed, 10 insertions, 1 deletions
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;