From 749eb49852f01a5696b9d39e5cd26ccdc1d20ca9 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Mon, 24 Oct 2022 08:49:25 +0100 Subject: [PATCH] dell: Fix plugin startup The fu_context_get_smbios_data() call will not work when creating the plugin GType, so just create the SMI object when it is needed in ->startup(). Fixes https://github.com/fwupd/firmware-dell/issues/144 --- plugins/dell/fu-dell-plugin.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/dell/fu-dell-plugin.c b/plugins/dell/fu-dell-plugin.c index 9f88ee1b9..7bc72cb2e 100644 --- a/plugins/dell/fu-dell-plugin.c +++ b/plugins/dell/fu-dell-plugin.c @@ -894,6 +894,7 @@ fu_dell_plugin_startup(FuPlugin *plugin, FuProgress *progress, GError **error) return FALSE; } + self->smi_obj->smi = dell_smi_factory(DELL_SMI_DEFAULTS); if (self->smi_obj->smi == NULL) { g_set_error(error, FWUPD_ERROR, @@ -955,8 +956,6 @@ fu_dell_plugin_constructed(GObject *obj) fu_context_add_runtime_version(ctx, "com.dell.libsmbios", tmp); g_debug("Using libsmbios %s", tmp); - if (fu_dell_supported(plugin)) - self->smi_obj->smi = dell_smi_factory(DELL_SMI_DEFAULTS); self->smi_obj->fake_smbios = FALSE; if (g_getenv("FWUPD_DELL_FAKE_SMBIOS") != NULL) self->smi_obj->fake_smbios = TRUE;