From patchwork Mon Sep 21 16:27:58 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: 309462 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 5F723C43466 for ; Mon, 21 Sep 2020 16:39:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3129D23A04 for ; Mon, 21 Sep 2020 16:39:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706378; bh=Gq+FUXLYeR0sXqEbuud5W6hNeqLYZJKW3NtM+LU8lh0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=pWex0t9xBpw8RMl7X3JrM9bwaIwn6lvY3ZQ6zS9CCf2oW9q9jX4sy6WQxPEfnlg4M 1F6rpquKSA/r2RX+PP+CTUC5b0/4h2xJTgaBCVyhpUOlhktlapacL1yPfAI5G07JcV uBR+LqJgMtpIWieIshWQnpGsBMM+WjnILrDxre0I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729281AbgIUQjg (ORCPT ); Mon, 21 Sep 2020 12:39:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:41356 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728857AbgIUQjZ (ORCPT ); Mon, 21 Sep 2020 12:39:25 -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 A0891238EE; Mon, 21 Sep 2020 16:39:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706365; bh=Gq+FUXLYeR0sXqEbuud5W6hNeqLYZJKW3NtM+LU8lh0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QACRubxrwHqK1uvO5LPA7KWtttgn+aT4YZYhL7SV7KqG5/Pay244xO3uPufjF4NzQ Tky3KAoeP2JGBkBzOrbpZ8RR4d3ofI5uNhqV+K4o9u9TVEJP+mEzFLCWOEeqJOrxx1 8obv3Xb1bexuUj13tjbLow7sm0LT5We43gjMS9UY= 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.14 71/94] nvme-fc: cancel async events before freeing event struct Date: Mon, 21 Sep 2020 18:27:58 +0200 Message-Id: <20200921162038.786478956@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162035.541285330@linuxfoundation.org> References: <20200921162035.541285330@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 13c89cc9d10cf..e95d2f75713e1 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c @@ -1566,6 +1566,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_FC_NR_AEN_COMMANDS; i++, aen_op++) { if (!aen_op->fcp_req.private)