qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 06/12] 9pfs: drop useless check in pdu_free()


From: Greg Kurz
Subject: [Qemu-devel] [PULL 06/12] 9pfs: drop useless check in pdu_free()
Date: Mon, 17 Oct 2016 17:05:48 +0200

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

Signed-off-by: Greg Kurz <address@hidden>
---
 hw/9pfs/9p.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index f2ab1dfab2b2..df8aa726c9a1 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);
     }
 }
 
-- 
2.5.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]