summaryrefslogtreecommitdiff
path: root/src/synaptics.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2014-02-22 01:44:37 -0800
committerPeter Hutterer <peter.hutterer@who-t.net>2014-02-24 08:00:29 +1000
commit22fe8bdc6668e78853768c62f4d1331114c7eca0 (patch)
treeb68b37f716489653d92fd31b895a82cdb5f69c23 /src/synaptics.c
parent402cc872570b58b8420e7973d0706f3b2a2aaf91 (diff)
Close device if DeviceOnHook fails
Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/synaptics.c')
-rw-r--r--src/synaptics.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/synaptics.c b/src/synaptics.c
index 5fd5edc..282ced7 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -972,8 +972,10 @@ DeviceOn(DeviceIntPtr dev)
}
if (priv->proto_ops->DeviceOnHook &&
- !priv->proto_ops->DeviceOnHook(pInfo, &priv->synpara))
+ !priv->proto_ops->DeviceOnHook(pInfo, &priv->synpara)) {
+ xf86CloseSerial(pInfo->fd);
return !Success;
+ }
priv->comm.buffer = XisbNew(pInfo->fd, INPUT_BUFFER_SIZE);
if (!priv->comm.buffer) {