From f3b1bc6c0c0d43a80ec5b3b867b96b9ba63cedc8 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Wed, 9 Nov 2016 19:44:29 +0000 Subject: [PATCH] trivial: Check the return code when using g_file_get_contents() Not actually a bug, but pointed out by Coverity. --- src/fu-provider-uefi.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/fu-provider-uefi.c b/src/fu-provider-uefi.c index fada876bf..b4e08f05c 100644 --- a/src/fu-provider-uefi.c +++ b/src/fu-provider-uefi.c @@ -315,10 +315,11 @@ fu_provider_uefi_coldplug (FuProvider *provider, GError **error) } /* set Display Name to the system for all capsules */ - g_file_get_contents ("/sys/class/dmi/id/product_name", - &display_name, NULL, NULL); - if (display_name != NULL) - g_strchomp (display_name); + if (g_file_get_contents ("/sys/class/dmi/id/product_name", + &display_name, NULL, NULL)) { + if (display_name != NULL) + g_strchomp (display_name); + } /* add each device */ guid = g_strdup ("00000000-0000-0000-0000-000000000000");