From patchwork Mon Sep 21 16:28:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263598 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B18FC43466 for ; Mon, 21 Sep 2020 16:58:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 55B6E2223E for ; Mon, 21 Sep 2020 16:58:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600707492; bh=g4zpzrrrliWT+jhYfAFzGjxB5RGCcotx6aZMPGxQUeM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Q93dLoxsZIeqRFD4hatGaocU/0c6eM4vdnNlGvRmrrAfroFKQD5bJRurYR7cwji7y fAhB8TcKKOuxGZjEbpQogGig/0e8ZKSbmTguKltutbt2VSaFN+6nwf/M9gBXhSD3SV ZD8EGc0HOuGoEXBxXLTWG1UNc/3ToQV4MaKCiDxE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729500AbgIUQ6L (ORCPT ); Mon, 21 Sep 2020 12:58:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:46690 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729262AbgIUQmd (ORCPT ); Mon, 21 Sep 2020 12:42:33 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 950C12076B; Mon, 21 Sep 2020 16:42:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706553; bh=g4zpzrrrliWT+jhYfAFzGjxB5RGCcotx6aZMPGxQUeM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l2OZis0zEWxpRdd7G8Kbnrl9IXd4birRqVHp2Xmgldt8ptfU7ffrSy4xTxIEdpWhc P2EtR23NYhhcnYNrIm6iX/LCmvvRds6q63YqPG0NavC2aTTk0F22zW8FyWXaQWRTC2 UqvVrV99/Y8+K1dqKO4Y2PvaH+sh74Y5c3oq6lCI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Milburn , Keith Busch , Sagi Grimberg , Christoph Hellwig , Sasha Levin Subject: [PATCH 4.19 19/49] nvme-fc: cancel async events before freeing event struct Date: Mon, 21 Sep 2020 18:28:03 +0200 Message-Id: <20200921162035.518685688@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162034.660953761@linuxfoundation.org> References: <20200921162034.660953761@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: David Milburn [ Upstream commit e126e8210e950bb83414c4f57b3120ddb8450742 ] Cancel async event work in case async event has been queued up, and nvme_fc_submit_async_event() runs after event has been freed. Signed-off-by: David Milburn Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- drivers/nvme/host/fc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index bb3b447c56468..73db32f97abf3 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c @@ -1791,6 +1791,7 @@ nvme_fc_term_aen_ops(struct nvme_fc_ctrl *ctrl) struct nvme_fc_fcp_op *aen_op; int i; + cancel_work_sync(&ctrl->ctrl.async_event_work); aen_op = ctrl->aen_ops; for (i = 0; i < NVME_NR_AEN_COMMANDS; i++, aen_op++) { if (!aen_op->fcp_req.private)