From 3fc94f03b5a0695a01073fd8d6ae50ae8ae00e1c Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 28 Sep 2020 16:12:51 +1000 Subject: [PATCH] libeis: warn if connecting a device without capabilities This is always a bug - where the device doesn't have recognized capabilities, it should be rejected. libeis does the right thing and converts the eis_device_connect() to a _disconnect() call but it's still useful to warn the caller. Signed-off-by: Peter Hutterer --- src/libeis-device.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libeis-device.c b/src/libeis-device.c index 83c6ad7..ba270a0 100644 --- a/src/libeis-device.c +++ b/src/libeis-device.c @@ -297,6 +297,9 @@ eis_device_connect(struct eis_device *device) return; if (device->capabilities_mask == 0) { + struct eis_client *client = eis_device_get_client(device); + log_bug(eis_client_get_context(client), + "Connecting a device without capabilities\n"); eis_device_disconnect(device); return; }