Skip to content

Commit 9ea7a46

Browse files
jnsnowmdroth
authored andcommitted
ahci: clear aiocb in ncq_cb
Similar to existing fixes for IDE (87ac25f) and ATAPI (7f951b2), 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 <[email protected]> Reviewed-by: Stefan Hajnoczi <[email protected]> Message-id: [email protected] Signed-off-by: John Snow <[email protected]> Signed-off-by: Michael Roth <[email protected]>
1 parent 1c57ced commit 9ea7a46

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

hw/ide/ahci.c

+1
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,7 @@ static void ncq_cb(void *opaque, int ret)
948948
NCQTransferState *ncq_tfs = (NCQTransferState *)opaque;
949949
IDEState *ide_state = &ncq_tfs->drive->port.ifs[0];
950950

951+
ncq_tfs->aiocb = NULL;
951952
if (ret == -ECANCELED) {
952953
return;
953954
}

0 commit comments

Comments
 (0)