From: John Snow Date: Mon, 26 Sep 2016 18:33:37 +0000 (-0400) Subject: ahci: clear aiocb in ncq_cb X-Git-Tag: v2.6.2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9ea7a46e2674edc84f056fc66c6f642d88b0c9ee;p=thirdparty%2Fqemu.git ahci: clear aiocb in ncq_cb 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 Reviewed-by: Stefan Hajnoczi Message-id: 1474575040-32079-2-git-send-email-jsnow@redhat.com Signed-off-by: John Snow Signed-off-by: Michael Roth --- diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index a1e651635af..b49fc5cfff0 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -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; }