The ena_restore_device() error path frees the admin queues before it resets the device, so the device can still write AENQ events, such as the keep-alive, into freed memory. Reset the device first, as ena_destroy_device() does. Fixes: d7703ddbd7c9 ("net: ena: fix rare bug when failed restart/resume is followed by driver removal") Signed-off-by: Yuho Choi --- I used an LLM to help write this patch and its changelog. Compile-tested only: QEMU has no ENA device, and KASAN cannot see writes made by the device. drivers/net/ethernet/amazon/ena/ena_netdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c index 560b20a5861c..5ef9c0967bb4 100644 --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c @@ -3370,8 +3370,8 @@ int ena_restore_device(struct ena_adapter *adapter) err_device_destroy: ena_com_abort_admin_commands(ena_dev); ena_com_wait_for_abort_completion(ena_dev); - ena_com_admin_destroy(ena_dev); ena_com_dev_reset(ena_dev, ENA_REGS_RESET_DRIVER_INVALID_STATE); + ena_com_admin_destroy(ena_dev); ena_phc_destroy(adapter); ena_com_mmio_reg_read_request_destroy(ena_dev); err: base-commit: fad0d57b12f6979bc0127f0a4f704c6d7177ca78 -- 2.56.1