summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-05-28 09:22:34 +0200
committerThomas Haller <thaller@redhat.com>2019-05-28 09:22:39 +0200
commit4385e27135e01e4aa261d37797a0f0445ef5b0b5 (patch)
treea844a48175bd9499c7032d275620de4678da7587
parent793998a1bccb35559461ea8dab0bf246bc454208 (diff)
downloadNetworkManager-bg/sriov-async.tar.gz
fixup! core: set number of SR-IOV VFs asynchronouslybg/sriov-async
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.
-rw-r--r--src/devices/nm-device.c9
1 files 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));
}
}