From 81c97eef9d1874f1ae6367e5dde7dcfdc9479e2a Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Sat, 25 Feb 2023 15:52:25 +0100 Subject: main: Fix warning for hidden device Some Bluetooth devices can be hidden if they also export their battery info through the kernel, so make sure to not throw a warning when they go away. (upowerd:133931): UPower-WARNING **: 02:49:48.012: INTERNAL STATE CORRUPT (device-removed): not sending NULL, device:0x1f5dae0 Fixes: 778b93a336be ("linux: Hide duplicate Logitech Bluetooth devices") --- src/up-daemon.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/up-daemon.c b/src/up-daemon.c index c2dd14b..b9f31d8 100644 --- a/src/up-daemon.c +++ b/src/up-daemon.c @@ -1001,13 +1001,14 @@ up_daemon_device_removed_cb (UpBackend *backend, UpDevice *device, UpDaemon *dae /* emit */ object_path = up_device_get_object_path (device); - g_debug ("emitting device-removed: %s", object_path); /* don't crash the session */ if (object_path == NULL) { - g_warning ("INTERNAL STATE CORRUPT (device-removed): not sending NULL, device:%p", device); + g_debug ("not emitting device-removed for unregistered device: %s", + up_exported_device_get_native_path (UP_EXPORTED_DEVICE (device))); return; } + g_debug ("emitting device-removed: %s", object_path); up_exported_daemon_emit_device_removed (UP_EXPORTED_DAEMON (daemon), object_path); /* In case a battery was removed */ -- cgit v1.2.1