From fdf1321fc781a9f9e36ea772647ce6e6b4a5325c Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Tue, 5 Mar 2013 18:00:50 +0100 Subject: 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 --- src/uvt_client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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); } /* -- cgit v1.2.3