Close device if DeviceOnHook fails

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Keith Packard
2014-02-22 01:44:37 -08:00
committed by Peter Hutterer
parent 402cc87257
commit 22fe8bdc66

View File

@@ -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) {