Date: Thu, 30 May 2019 13:35:44 +0000 (UTC) From: Marcin Wojtas <mw@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348407 - head/sys/dev/ena Message-ID: <201905301335.x4UDZiex071835@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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@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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905301335.x4UDZiex071835>