[spice PATCH 03/55] agent: don't attempt to read from the device if it was released

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

 



if vdi_port_read_buf_process failes, we detach the agent and also release
the read buffer. We shouldn't try reading from the device afterwards.
---
 server/reds.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/server/reds.c b/server/reds.c
index 8d6dbfb..53f0a39 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -831,7 +831,9 @@ static void vdi_port_read_buf_unref(VDIReadBuf *buf)
         ring was empty. So we call it again so it can complete its work if
         necessary. Note that since we can be called from spice_char_device_wakeup
         this can cause recursion, but we have protection for that */
-        spice_char_device_wakeup(reds->agent_state.base);
+        if (reds->agent_state.base) {
+            spice_char_device_wakeup(reds->agent_state.base);
+        }
     }
 }
 
-- 
1.7.7.6

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]