qemu-ppc
[Top][All Lists]
Advanced

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

[Qemu-ppc] [PATCH for-1.4] net: Avoid NULL function pointer dereference


From: Andreas Färber
Subject: [Qemu-ppc] [PATCH for-1.4] net: Avoid NULL function pointer dereference on cleanup
Date: Tue, 12 Feb 2013 23:16:06 +0100

The pSeries machine and some other devices don't supply a cleanup
callback. Revert part of 1ceef9f27359cbe92ef124bf74de6f792e71f6fb that
started calling it unconditionally.

Cc: Jason Wang <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
---
 net/net.c |    4 +++-
 1 Datei geändert, 3 Zeilen hinzugefügt(+), 1 Zeile entfernt(-)

diff --git a/net/net.c b/net/net.c
index f9e7136..be03a8d 100644
--- a/net/net.c
+++ b/net/net.c
@@ -287,7 +287,9 @@ static void qemu_cleanup_net_client(NetClientState *nc)
 {
     QTAILQ_REMOVE(&net_clients, nc, next);
 
-    nc->info->cleanup(nc);
+    if (nc->info->cleanup) {
+        nc->info->cleanup(nc);
+    }
 }
 
 static void qemu_free_net_client(NetClientState *nc)
-- 
1.7.10.4




reply via email to

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