]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
ahci: clear aiocb in ncq_cb
authorJohn Snow <jsnow@redhat.com>
Mon, 26 Sep 2016 18:33:37 +0000 (14:33 -0400)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 28 Sep 2016 16:54:06 +0000 (11:54 -0500)
Similar to existing fixes for IDE (87ac25fd) and ATAPI (7f951b2d), the
AIOCB must be cleared in the callback. Otherwise, we may accidentally
try to reset a dangling pointer in bdrv_aio_cancel() from a port reset.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1474575040-32079-2-git-send-email-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/ide/ahci.c

index a1e651635af25c2ac170d5b5ba52a17363117086..b49fc5cfff0b02f25a0b5dbe26397fe5dd2c8493 100644 (file)
@@ -948,6 +948,7 @@ static void ncq_cb(void *opaque, int ret)
     NCQTransferState *ncq_tfs = (NCQTransferState *)opaque;
     IDEState *ide_state = &ncq_tfs->drive->port.ifs[0];
 
+    ncq_tfs->aiocb = NULL;
     if (ret == -ECANCELED) {
         return;
     }