From 1a6ec3ee76a2e33d6c86ad81d00922dabe426f50 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Sun, 8 Jun 2014 07:21:43 -0700 Subject: [PATCH] init.c: use list macro when removing pdus from the wait list Use the macro when removing the pdus in the wait list from the queues. Also make sure to remove them from the right queue, from waitqueue and not the outqueue for PDUs we have already sent out. Signed-off-by: Ronnie Sahlberg --- lib/init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/init.c b/lib/init.c index 782a7ea..bbed183 100644 --- a/lib/init.c +++ b/lib/init.c @@ -235,7 +235,7 @@ void rpc_destroy_context(struct rpc_context *rpc) while((pdu = rpc->outqueue.head) != NULL) { pdu->cb(rpc, RPC_STATUS_CANCEL, NULL, pdu->private_data); - rpc->outqueue.head = pdu->next; + LIBNFS_LIST_REMOVE(&rpc->outqueue.head, pdu); rpc_free_pdu(rpc, pdu); } @@ -244,7 +244,7 @@ void rpc_destroy_context(struct rpc_context *rpc) while((pdu = q->head) != NULL) { pdu->cb(rpc, RPC_STATUS_CANCEL, NULL, pdu->private_data); - rpc->outqueue.head = pdu->next; + LIBNFS_LIST_REMOVE(&q->head, pdu); rpc_free_pdu(rpc, pdu); } } -- 2.34.1