From b311ae9e5b5a6a9b014285df660f4edb3cc5c00f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Thu, 19 Dec 2019 10:23:14 +0100 Subject: [PATCH] node_device: Don't check the output of virGetUserRuntimeDirectory() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit virGetUserRuntimeDirectory() *never* *ever* returns NULL, making the checks for it completely unnecessary. Signed-off-by: Fabiano Fidêncio Reviewed-by: Ján Tomko --- src/node_device/node_device_hal.c | 3 +-- src/node_device/node_device_udev.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/node_device/node_device_hal.c b/src/node_device/node_device_hal.c index b40f93df46..cf12854fe9 100644 --- a/src/node_device/node_device_hal.c +++ b/src/node_device/node_device_hal.c @@ -618,8 +618,7 @@ nodeStateInitialize(bool privileged G_GNUC_UNUSED, } else { g_autofree char *rundir = NULL; - if (!(rundir = virGetUserRuntimeDirectory())) - goto failure; + rundir = virGetUserRuntimeDirectory(); driver->stateDir = g_strdup_printf("%s/nodedev/run", rundir); } diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c index cae00dc9dc..eedcd123a3 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -1806,8 +1806,7 @@ nodeStateInitialize(bool privileged, } else { g_autofree char *rundir = NULL; - if (!(rundir = virGetUserRuntimeDirectory())) - goto cleanup; + rundir = virGetUserRuntimeDirectory(); driver->stateDir = g_strdup_printf("%s/nodedev/run", rundir); }