libeis: a device in NEW state must be disconnected too

NEW means "client has sent request" which means we have a ref to it internally
and we have to disconnect it accordingly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2020-08-07 15:05:40 +10:00
parent 2f855c568c
commit 5d99d858bf

View file

@ -134,7 +134,7 @@ eis_device_connect(struct eis_device *device)
_public_ void
eis_device_disconnect(struct eis_device *device)
{
if (device->state != EIS_DEVICE_STATE_ACCEPTED)
if (device->state == EIS_DEVICE_STATE_REMOVED)
return;
device->state = EIS_DEVICE_STATE_REMOVED;