qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH] dvs services stop then qemu may be accesse null add


From: indiffPig
Subject: [Qemu-devel] [PATCH] dvs services stop then qemu may be accesse null address case core
Date: Fri, 14 Jul 2017 07:27:57 -0400

From: "yin.zuowei" <address@hidden>

Signed-off-by: yin.zuowei <address@hidden>
---
 chardev/char-fe.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/chardev/char-fe.c b/chardev/char-fe.c
index 3f90f05..82f7e2b 100644
--- a/chardev/char-fe.c
+++ b/chardev/char-fe.c
@@ -353,7 +353,13 @@ guint qemu_chr_fe_add_watch(CharBackend *be, GIOCondition 
cond,
 
 void qemu_chr_fe_disconnect(CharBackend *be)
 {
-    Chardev *chr = be->chr;
+    Chardev *chr = NULL;
+
+    if (be) {
+        chr = be->chr;
+    } else {
+        return ;
+    }
 
     if (chr && CHARDEV_GET_CLASS(chr)->chr_disconnect) {
         CHARDEV_GET_CLASS(chr)->chr_disconnect(chr);
-- 
1.8.3.1





reply via email to

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