Date: Thu, 12 Nov 2020 20:20:44 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367625 - head/sys/dev/nvme Message-ID: <202011122020.0ACKKiXq089903@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Thu Nov 12 20:20:43 2020 New Revision: 367625 URL: https://svnweb.freebsd.org/changeset/base/367625 Log: Fix panic if NVMe is detached before the intrhook call. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/dev/nvme/nvme.c head/sys/dev/nvme/nvme_ctrlr.c Modified: head/sys/dev/nvme/nvme.c ============================================================================== --- head/sys/dev/nvme/nvme.c Thu Nov 12 20:02:48 2020 (r367624) +++ head/sys/dev/nvme/nvme.c Thu Nov 12 20:20:43 2020 (r367625) @@ -139,9 +139,14 @@ nvme_attach(device_t dev) } int -nvme_detach (device_t dev) +nvme_detach(device_t dev) { struct nvme_controller *ctrlr = DEVICE2SOFTC(dev); + + if (ctrlr->config_hook.ich_arg != NULL) { + config_intrhook_disestablish(&ctrlr->config_hook); + ctrlr->config_hook.ich_arg = NULL; + } nvme_ctrlr_destruct(ctrlr, dev); return (0); Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Thu Nov 12 20:02:48 2020 (r367624) +++ head/sys/dev/nvme/nvme_ctrlr.c Thu Nov 12 20:20:43 2020 (r367625) @@ -1135,6 +1135,7 @@ nvme_ctrlr_start_config_hook(void *arg) fail: nvme_ctrlr_fail(ctrlr); config_intrhook_disestablish(&ctrlr->config_hook); + ctrlr->config_hook.ich_arg = NULL; return; } @@ -1152,6 +1153,7 @@ fail: nvme_sysctl_initialize_ctrlr(ctrlr); config_intrhook_disestablish(&ctrlr->config_hook); + ctrlr->config_hook.ich_arg = NULL; ctrlr->is_initialized = 1; nvme_notify_new_controller(ctrlr);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202011122020.0ACKKiXq089903>