summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorYonit Halperin <yhalperi@redhat.com>2012-08-11 23:41:22 +0300
committerYonit Halperin <yhalperi@redhat.com>2012-08-27 09:04:51 +0300
commit8d02c14d20f95148a65e86fbb2ec97a223fa5c24 (patch)
tree996650040916b6657576a69ef0ce382a44323191 /server
parent56c9548f6471878a16cad90cc028defdae2cc7c4 (diff)
downloadspice-8d02c14d20f95148a65e86fbb2ec97a223fa5c24.tar.gz
spice-8d02c14d20f95148a65e86fbb2ec97a223fa5c24.tar.xz
spice-8d02c14d20f95148a65e86fbb2ec97a223fa5c24.zip
agent: don't attempt to read from the device if it was released
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.
Diffstat (limited to 'server')
-rw-r--r--server/reds.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/server/reds.c b/server/reds.c
index 8d6dbfb7..53f0a396 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);
+ }
}
}