From d07827dfe1c0d676e56dc1da20f2f96e76f4e6cb Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 17 Apr 2023 11:35:06 +0200 Subject: [PATCH] device: minor cleanup of code path in delete_cb() (cherry picked from commit c68cbcb8fa8d73c4b6dffae1b3773901f8244b40) (cherry picked from commit ae430f37ed64f7a78ee6912b39687a174113714d) --- src/core/devices/nm-device.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c index 62a9ff1e84..0f081983ee 100644 --- a/src/core/devices/nm-device.c +++ b/src/core/devices/nm-device.c @@ -13429,10 +13429,13 @@ delete_cb(NMDevice *self, /* Authorized */ nm_audit_log_device_op(NM_AUDIT_OP_DEVICE_DELETE, self, TRUE, NULL, subject, NULL); - if (nm_device_unrealize(self, TRUE, &local)) - g_dbus_method_invocation_return_value(context, NULL); - else + + if (!nm_device_unrealize(self, TRUE, &local)) { g_dbus_method_invocation_take_error(context, local); + return; + } + + g_dbus_method_invocation_return_value(context, NULL); } static void