summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-05-05 11:02:20 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-05-05 11:02:20 +1000
commit881f85578ab4a7c02375bcfc10026ad1a0800cdb (patch)
tree0cbc51f485dcbf2436789e41ce89de7d7d0ee903 /src
parent2b3325dc53d1a560b94b9c88aeb05b0f7f9085cd (diff)
If QueryHardware failed, return that failure and clean up.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Christoph Brill <egore911@egore911.de> Signed-off-by: Henrik Rydberg <rydberg@euromail.se> (cherry picked from commit a9a443959585e7f65ba3f300d387cf617d9df77b) Conflicts: src/synaptics.c
Diffstat (limited to 'src')
-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;