From d11f41a8a09cf7f81c49d962ce2187b426c98a4b Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 30 Sep 2013 19:50:50 +0200 Subject: [PATCH] team: fix wrong assertion in device-team The assertion that priv->teamd_pid is set does not hold. For example, if no teamd binary can be found, "Stage 1 of 5 (Device Prepare)" fails with "Activation (nm-team) to start teamd: not found". This causes the device state to become "failed" and later "disconnected", which in turn calls teamd_stop without a valid teamd_pid set. Signed-off-by: Thomas Haller --- src/devices/nm-device-team.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/devices/nm-device-team.c b/src/devices/nm-device-team.c index db16465254..e93dfcfa67 100644 --- a/src/devices/nm-device-team.c +++ b/src/devices/nm-device-team.c @@ -473,9 +473,13 @@ teamd_start (NMDevice *dev, NMSettingTeam *s_team, NMDeviceTeamPrivate *priv) static void teamd_stop (NMDevice *dev, NMDeviceTeamPrivate *priv) { - g_return_if_fail (priv->teamd_pid > 0); - nm_log_info (LOGD_TEAM, "Deactivation (%s) stopping teamd...", - nm_device_get_ip_iface (dev)); + if (priv->teamd_pid > 0) { + nm_log_info (LOGD_TEAM, "Deactivation (%s) stopping teamd...", + nm_device_get_ip_iface (dev)); + } else { + nm_log_dbg (LOGD_TEAM, "Deactivation (%s) stopping teamd (not started)...", + nm_device_get_ip_iface (dev)); + } teamd_cleanup (dev); }