From f1399580b56dcda53a4495bc581a70f59db28e91 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Mon, 26 Jun 2017 17:17:01 +0100 Subject: [PATCH] unifying: Do not allow closing a non-open device --- plugins/unifying/lu-device.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/unifying/lu-device.c b/plugins/unifying/lu-device.c index 2408a69e7..f25cea5da 100644 --- a/plugins/unifying/lu-device.c +++ b/plugins/unifying/lu-device.c @@ -822,6 +822,10 @@ lu_device_close (LuDevice *device, GError **error) g_return_val_if_fail (LU_IS_DEVICE (device), FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + /* not open */ + if (!lu_device_has_flag (device, LU_DEVICE_FLAG_IS_OPEN)) + return TRUE; + /* subclassed */ g_debug ("closing device"); if (klass->close != NULL) {