Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp466751ybm; Fri, 29 May 2020 04:41:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfvx5/PayXgT5/GWfewZUCOozjCTE81sje1R8Ce3z9DMTQsPpLRqgwSt5rRE6o0xYery3K X-Received: by 2002:a17:906:16d3:: with SMTP id t19mr7079066ejd.36.1590752518807; Fri, 29 May 2020 04:41:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590752518; cv=none; d=google.com; s=arc-20160816; b=Hd+Z5p41DI6txnMXxqTXwaIsEOWaDrC5zYHmkrD/lLhwXJM8mTXt+U2J1Q5s1VbIOz K1faXMU/RYFvVzlKavWJLdvm53pZHPH8NOw4Fqvi2OOvOQHyydbZT9ru+4QJZXpzjc63 BvqJXxhiUwU9qyJGVyLLhV0iqUurKdZnM2dPKVa7dRFFYBvd36FhavWsx6iSMmcsQtA+ 4kxW9iS7dcD80ggHKYY1+l1yT5ftjRU/BzBR3v8aS5V49KwAL4upWy9oW4OWiFbIFic4 mPuwWkbDx+u2XmKM3KztuxISUTWkvppIMLsvPNelTseCdOkRbOujfY18thGPtfgokXoD DSoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=aKDx8AH6IE1woNJ6v3fZDyMzasCBX2I4mKJUGn6Z4sc=; b=Lb+IH2/HVsp+hS0R6H3CZ10Mxbk5a4+P0OUpkkR7FU1qqfHOC7WFVIUIMdjRGw5kmx uBLFSE3VJvZFw60V9GpbQiT9p4/W4v+Q+kGv8N9GL9CG8eQ2wNKDQ/5lRcVHihLPEShl 9VkR6ft0BI89nmpTxVEtUvO+Zd+7fcVR1c9hXUvRKL0ywEkmCwmD4q9FDR4Jb4z7Qmm4 UszRJHgnHGhFoLl33Pn1U7ck/6JbLPbk7z/i8FormVVr/jCAKptoxWEWTUGzfSDzcIFQ y1gUh0EseQVqC91Gka6HLnEEwsw6NLQdHoHAJYMGn3OyZ51UmAMM6K3d4GBg1/t+op8x eX+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y5si5093797edu.171.2020.05.29.04.41.33; Fri, 29 May 2020 04:41:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726052AbgE2Lhp (ORCPT + 99 others); Fri, 29 May 2020 07:37:45 -0400 Received: from mx2.suse.de ([195.135.220.15]:51032 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725562AbgE2Lho (ORCPT ); Fri, 29 May 2020 07:37:44 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 6E4A2AE54; Fri, 29 May 2020 11:37:43 +0000 (UTC) From: Daniel Wagner To: linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, James Smart , Keith Busch , Daniel Wagner , Max Gurtovoy Subject: [PATCH] nvme-fc: Only call nvme_cleanup_cmd() for normal operations Date: Fri, 29 May 2020 13:37:40 +0200 Message-Id: <20200529113740.31269-1-dwagner@suse.de> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Asynchronous event notifications do not have an request associated. When fcp_io() fails we unconditionally call nvme_cleanup_cmd() which leads to a crash. Fixes: 16686f3a6c3c ("nvme: move common call to nvme_cleanup_cmd to core layer") Cc: Max Gurtovoy Signed-off-by: Daniel Wagner --- drivers/nvme/host/fc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index 7dfc4a2ecf1e..287a3e8ea317 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c @@ -2300,10 +2300,11 @@ nvme_fc_start_fcp_op(struct nvme_fc_ctrl *ctrl, struct nvme_fc_queue *queue, opstate = atomic_xchg(&op->state, FCPOP_STATE_COMPLETE); __nvme_fc_fcpop_chk_teardowns(ctrl, op, opstate); - if (!(op->flags & FCOP_FLAGS_AEN)) + if (!(op->flags & FCOP_FLAGS_AEN)) { nvme_fc_unmap_data(ctrl, op->rq, op); + nvme_cleanup_cmd(op->rq); + } - nvme_cleanup_cmd(op->rq); nvme_fc_ctrl_put(ctrl); if (ctrl->rport->remoteport.port_state == FC_OBJSTATE_ONLINE && -- 2.26.2