From nobody Fri Jun 14 19:33:40 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4W18b86FsMz5PNcc; Fri, 14 Jun 2024 19:33:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4W18b85gwVz4NZl; Fri, 14 Jun 2024 19:33:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718393620; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lPNkom6noheerE0y2EDzp+AiKMH0ZtLcZLfCBnLyLs8=; b=hV7RU2y04uks6BwmJR3X0D6klNowscFjLwFWH0ySXrpeLgz7wV9e9ZmQDYKUMwd4cAHfwa e97vwe/+LTWtfIrWAYhLiL5do8a+L4sM1xBwfiyHUOIHfUFuOerkSZzrcXSQDlCL8mb0XW fMOO1s74aLk3oGiOMAWpJRuwmzKRkYZc+2ghSQp8T/gTmJLzH1gD+DAQ+wDTmFHJqOwKiJ L1WSj/3LXzHmZpT4XIHH2qoAzOhKt3tZvw1mCNaApmNGxCJE8hpNI3QpccJiSzsT3XTJhN yt3EN0k2zb6B6p7XdXp9hDC1AeuJ55Usbuq1JldskmLrNPClgl8RVunEr5wJTw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718393620; a=rsa-sha256; cv=none; b=ZrTgWLIG200/AzXteu3aHBbqM5t2kZsZmLzv8LHbnXVQ62BrZY1ydNzyYVfVNQihwA1XLy 1yCHScaKfKNYCAYaBy4o1c5Y0JmZTuYIKL/0fyVMfyA0+RZHXRK1E5o2Xf50jXf/da2PTK AVRA0arSPQnc49CHFldzt8tE53ZvX8X5dkHn9DvbFly5Ye91RmVKo7xWQXNAZM6JJcNZ6V xBuOT71PvQ/mNlie3YxH8EgV0OH6h9XqjwmHeiomG9JB/9/XYas2eIeL6qIbjGgXbjIBUV BEJRgwZSpvY2KXXOrVCXOs0+2ENwbJquZXw7VMPRVtMpLM3vDSOcWptOY8lHSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718393620; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lPNkom6noheerE0y2EDzp+AiKMH0ZtLcZLfCBnLyLs8=; b=TMY1aJ71H0wFi72nVovSn63zpEl2mlhutMPaM/k6b1VOU6PSrxgSejtaMe0nlzTtqk2Xsj Dblj+FohFEA5nUHrq9AEhW7y2KR3b8vC6r3O2dyVjctDqMQW3ctpw+A3Y6Cot+bpQv8Eo+ zf+cqZqFWsAF9+4UMlWDTmxzWsAusvQJms18+C3ujlNJ7vf90W0aHi264EcZpta/si7lbb DXchc58wPPFQUFzdjpvFZRCso+CpKgq6iJtRgnpcPJcpvHXf09jlaBvPXvQ/uTljUvnlux O/mqr3AzFnacgqTs+/LjLExYmALzb2VzgwKL6qpRih/z9f1jWmPFDmyNG0X40Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4W18b85HlHzZ1k; Fri, 14 Jun 2024 19:33:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 45EJXeaB005088; Fri, 14 Jun 2024 19:33:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45EJXeOl005085; Fri, 14 Jun 2024 19:33:40 GMT (envelope-from git) Date: Fri, 14 Jun 2024 19:33:40 GMT Message-Id: <202406141933.45EJXeOl005085@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 80b42329248a - main - nvme: Fix panic on detach after ce75bfcac9cfe List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 80b42329248a7473f79eebf7850ee8e4116c17dd Auto-Submitted: auto-generated The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=80b42329248a7473f79eebf7850ee8e4116c17dd commit 80b42329248a7473f79eebf7850ee8e4116c17dd Author: Alexander Motin AuthorDate: 2024-06-14 19:32:10 +0000 Commit: Alexander Motin CommitDate: 2024-06-14 19:32:10 +0000 nvme: Fix panic on detach after ce75bfcac9cfe MFC after: 2 weeks --- sys/dev/nvme/nvme_ns.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/dev/nvme/nvme_ns.c b/sys/dev/nvme/nvme_ns.c index b19fc8664407..4c65e2c49e64 100644 --- a/sys/dev/nvme/nvme_ns.c +++ b/sys/dev/nvme/nvme_ns.c @@ -620,8 +620,9 @@ void nvme_ns_destruct(struct nvme_namespace *ns) { - if (ns->cdev->si_drv2 != NULL) - destroy_dev(ns->cdev->si_drv2); - if (ns->cdev != NULL) + if (ns->cdev != NULL) { + if (ns->cdev->si_drv2 != NULL) + destroy_dev(ns->cdev->si_drv2); destroy_dev(ns->cdev); + } }