svn commit: r348407 - head/sys/dev/ena
Marcin Wojtas
mw at FreeBSD.org
Thu May 30 13:35:45 UTC 2019
Author: mw
Date: Thu May 30 13:35:43 2019
New Revision: 348407
URL: https://svnweb.freebsd.org/changeset/base/348407
Log:
Fix error handling when ENA reset fails
Before the patch, error handling was not releasing all resources and
was not issuing device reset if the reset task failed.
That could cause memory leak and fault of the device.
Submitted by: Michal Krawczyk <mk at semihalf.com>
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Modified:
head/sys/dev/ena/ena.c
Modified: head/sys/dev/ena/ena.c
==============================================================================
--- head/sys/dev/ena/ena.c Thu May 30 13:35:02 2019 (r348406)
+++ head/sys/dev/ena/ena.c Thu May 30 13:35:43 2019 (r348407)
@@ -4130,7 +4130,11 @@ err_msix_free:
ena_free_mgmnt_irq(adapter);
ena_disable_msix(adapter);
err_com_free:
+ ena_com_abort_admin_commands(ena_dev);
+ ena_com_wait_for_abort_completion(ena_dev);
ena_com_admin_destroy(ena_dev);
+ ena_com_mmio_reg_read_request_destroy(ena_dev);
+ ena_com_dev_reset(ena_dev, ENA_REGS_RESET_DRIVER_INVALID_STATE);
err_dev_free:
device_printf(adapter->pdev, "ENA reset failed!\n");
adapter->running = false;
More information about the svn-src-all
mailing list