9pfs: drop useless check in pdu_free()

Out of the three users of pdu_free(), none ever passes a NULL pointer to
this function.

Signed-off-by: Greg Kurz <groug@kaod.org>
This commit is contained in:
Greg Kurz 2016-10-17 14:13:58 +02:00
parent 8440e22ec1
commit 6868a420c5
1 changed files with 8 additions and 10 deletions

View File

@ -626,16 +626,14 @@ V9fsPDU *pdu_alloc(V9fsState *s)
void pdu_free(V9fsPDU *pdu)
{
if (pdu) {
V9fsState *s = pdu->s;
/*
* Cancelled pdu are added back to the freelist
* by flush request .
*/
if (!pdu->cancelled) {
QLIST_REMOVE(pdu, next);
QLIST_INSERT_HEAD(&s->free_list, pdu, next);
}
V9fsState *s = pdu->s;
/*
* Cancelled pdu are added back to the freelist
* by flush request .
*/
if (!pdu->cancelled) {
QLIST_REMOVE(pdu, next);
QLIST_INSERT_HEAD(&s->free_list, pdu, next);
}
}