aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/9pfs/9p.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index e71a3e8491..983a65091c 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -2337,7 +2337,7 @@ static void v9fs_flush(void *opaque)
ssize_t err;
int16_t tag;
size_t offset = 7;
- V9fsPDU *cancel_pdu;
+ V9fsPDU *cancel_pdu = NULL;
V9fsPDU *pdu = opaque;
V9fsState *s = pdu->s;
@@ -2348,9 +2348,13 @@ static void v9fs_flush(void *opaque)
}
trace_v9fs_flush(pdu->tag, pdu->id, tag);
- QLIST_FOREACH(cancel_pdu, &s->active_list, next) {
- if (cancel_pdu->tag == tag) {
- break;
+ if (pdu->tag == tag) {
+ error_report("Warning: the guest sent a self-referencing 9P flush request");
+ } else {
+ QLIST_FOREACH(cancel_pdu, &s->active_list, next) {
+ if (cancel_pdu->tag == tag) {
+ break;
+ }
}
}
if (cancel_pdu) {