summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2013-03-05 18:00:50 +0100
committerDavid Herrmann <dh.herrmann@gmail.com>2013-03-05 18:00:50 +0100
commitfdf1321fc781a9f9e36ea772647ce6e6b4a5325c (patch)
tree9dbd5ed7c5b9c61604735d7d290d34c69cbae2f9
parenta9219924c8b5087deb114826c94644b93cb10901 (diff)
uvt: client: fix double-kill by first unlinkink then resetting
We _must_ unlink the client and cdev first, then reset the VT. Otherwise, the set_vt() call might think we are still alive and call user-defined callbacks which might call kill again. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
-rw-r--r--src/uvt_client.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/uvt_client.c b/src/uvt_client.c
index fcacfc0..1735673 100644
--- a/src/uvt_client.c
+++ b/src/uvt_client.c
@@ -405,10 +405,10 @@ void uvt_client_kill(struct uvt_client *client)
client->ph = NULL;
}
- uvt_client_set_vt(client, NULL, NULL);
- uvt_client_waiters_release(client, -EPIPE);
shl_dlist_unlink(&client->list);
client->cdev = NULL;
+ uvt_client_set_vt(client, NULL, NULL);
+ uvt_client_waiters_release(client, -EPIPE);
}
/*