From patchwork Mon Sep 21 16:30: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: 263656 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=unavailable 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 D73B1C43465 for ; Mon, 21 Sep 2020 16:50:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 863D02395B for ; Mon, 21 Sep 2020 16:50:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600707010; bh=C87FEcxOQvwbve5njzgtcQ3YGHj3Yux44IZWafvgDVk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=nYxJcxnJFXkAEZ7ROuHKzCh5bo2SyBikC57rgmW2ktt2goDM5U4RJR5O5cgTwHg9p VX4CyrA70am78MIHbP85pyM7mrNTm8ik1ovHcIunXhvmW3WWLebiY98DqdlS4tCIsO 1K3oepcbrvs2ecMwKU8ATNhAszCrPFND5CNQfYlY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729586AbgIUQuE (ORCPT ); Mon, 21 Sep 2020 12:50:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:58340 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729975AbgIUQuE (ORCPT ); Mon, 21 Sep 2020 12:50:04 -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 B04992223E; Mon, 21 Sep 2020 16:50:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600707003; bh=C87FEcxOQvwbve5njzgtcQ3YGHj3Yux44IZWafvgDVk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J1GCkzMeQZImB+TBdBBOfWwFhR/azfGaiFZkf1aDbaKw2uHzns7xNIru/9fuCNr7D W3XDYnHMqyzcSdYjNhfLnz0Ej/EvLB7g48DejMKTK2wvHmLRJeYcHvpBdpAsYnHbKI DhWheglL7d6TYFusDtdyB+qvp3eR5QpAyP7j5C5s= 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 5.4 19/72] nvme-fc: cancel async events before freeing event struct Date: Mon, 21 Sep 2020 18:30:58 +0200 Message-Id: <20200921163122.778620377@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921163121.870386357@linuxfoundation.org> References: <20200921163121.870386357@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 dce4d6782ceb1..dae050d1f814d 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c @@ -1820,6 +1820,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)