summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorGreg Kurz <groug@kaod.org>2016-10-17 14:13:58 +0200
committerGreg Kurz <groug@kaod.org>2016-10-17 14:13:58 +0200
commit6868a420c519d74926ea814d48f6ce9beda35b98 (patch)
tree6e94eba29caa13ab358a773f059f177fed753ada
parent8440e22ec1a5deabc4fcf5c4826d5c73ddc15765 (diff)
downloadfocaccia-qemu-6868a420c519d74926ea814d48f6ce9beda35b98.tar.gz
focaccia-qemu-6868a420c519d74926ea814d48f6ce9beda35b98.zip
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>
-rw-r--r--hw/9pfs/9p.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index f2ab1dfab2..df8aa726c9 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -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);
     }
 }