From 4385e27135e01e4aa261d37797a0f0445ef5b0b5 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 28 May 2019 09:22:34 +0200 Subject: fixup! core: set number of SR-IOV VFs asynchronously Clear "pending" field before invoking callbacks. Invoking callbacks means to call unknown code, that might again try to queue an operation. Likewise, clear "next" before calling sriov_op_start() -- although here it's more clear that sriov_op_start() does nothing that could cause a conflict. Also, no need to cancel the cancellable. Just unref it. --- src/devices/nm-device.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index b0b2979bc5..46ba294013 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -4234,16 +4234,17 @@ sriov_op_cb (GError *error, gpointer user_data) nm_assert (op == priv->sriov.pending); + priv->sriov.pending = NULL; + if (op->callback) op->callback (error, op->callback_data); - nm_clear_g_cancellable (&op->cancellable); + g_clear_object (&op->cancellable); g_slice_free (SriovOp, op); - priv->sriov.pending = NULL; if (priv->sriov.next) { - sriov_op_start (self, priv->sriov.next); - priv->sriov.next = NULL; + sriov_op_start (self, + g_steal_pointer (&priv->sriov.next)); } } -- cgit v1.2.1