From e3c8832dd09fdc02ed62d16e90ea2a21362019ff Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Wed, 11 Jan 2017 21:48:59 +0000 Subject: [PATCH] trivial: Fix a critical warning when removing thunderbolt devices in safe mode --- plugins/thunderbolt/fu-plugin-thunderbolt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/thunderbolt/fu-plugin-thunderbolt.c b/plugins/thunderbolt/fu-plugin-thunderbolt.c index bafe74876..f00369a46 100644 --- a/plugins/thunderbolt/fu-plugin-thunderbolt.c +++ b/plugins/thunderbolt/fu-plugin-thunderbolt.c @@ -72,7 +72,8 @@ static void fu_plugin_thunderbolt_info_free (FuThunderboltInfo *info) { g_free (info->id); - g_object_unref (info->dev); + if (info->dev != NULL) + g_object_unref (info->dev); g_slice_free (FuThunderboltInfo, info); } @@ -111,7 +112,8 @@ fu_plugin_thunderbolt_rescan (FuPlugin *plugin, GError **error) tbt_strerror (rc)); return FALSE; } - g_debug ("found %i thunderbolt controllers", data->controllers_len); + g_debug ("found %" G_GSIZE_FORMAT " thunderbolt controllers", + data->controllers_len); /* no longer valid */ for (guint i = 0; i < data->infos->len; i++) {