[PATCH 1/2] Close device if DeviceOnHook fails
Keith Packard
keithp at keithp.com
Sat Feb 22 01:44:37 PST 2014
Signed-off-by: Keith Packard <keithp at keithp.com>
---
src/synaptics.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
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) {
--
1.9.0
More information about the xorg-devel
mailing list