From c189854a688465c820d5ef5767e00b69394a1601 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 22 Feb 2014 01:44:37 -0800 Subject: Close device if DeviceOnHook fails Signed-off-by: Keith Packard Signed-off-by: Peter Hutterer (cherry picked from commit 22fe8bdc6668e78853768c62f4d1331114c7eca0) --- src/synaptics.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/synaptics.c b/src/synaptics.c index 1c22873..0986e20 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -959,8 +959,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) { -- cgit v1.2.3