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 <ronniesahlberg@gmail.com>
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);
}
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);
}
}