From mboxrd@z Thu Jan 1 00:00:00 1970 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 BBC3FC43466 for ; Mon, 21 Sep 2020 16:52:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6B5F420874 for ; Mon, 21 Sep 2020 16:52:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600707144; bh=+6SUSIhECxDd5uZsrfq5ix7Ft2DJ+36V2X1rUbHe6dI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=zzeG/HgvtqWqWYFS/TzHqHradV6iyv9b/sTdPrkWy7lgOlylJiSEVOW48YEg0NyTa f6k9Jzsj0ONysQK04ZrJ1DCyxkJ8V1vYi5niuN73YrzDTW3OIgXwrbgYlXwj3Op+Wu sCHzZ7qpssImM7/QuqVE2Nyx3W6O2xT0TQcy3+fQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730114AbgIUQwX (ORCPT ); Mon, 21 Sep 2020 12:52:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:57028 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729884AbgIUQtJ (ORCPT ); Mon, 21 Sep 2020 12:49:09 -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 A787D23888; Mon, 21 Sep 2020 16:49:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706949; bh=+6SUSIhECxDd5uZsrfq5ix7Ft2DJ+36V2X1rUbHe6dI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xMFMm3mz6IbTigPiMTw1SKARS4BqyPUqGI5h9fftJCueCNmc2r9sBy9Z9BXVQ15LV Dsi5SB4f9RWLGso7Tx7EphzEoYSgIxkFS03Txadxs0eqNMfJ+i/BFRUHBhMUvmK9p9 0xPdk8FmZYt/QMLE72nYqqSPtQgISiuFuMzp3thY= 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 21/72] nvme-tcp: cancel async events before freeing event struct Date: Mon, 21 Sep 2020 18:31:00 +0200 Message-Id: <20200921163122.874460458@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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Milburn [ Upstream commit ceb1e0874dba5cbfc4e0b4145796a4bfb3716e6a ] Cancel async event work in case async event has been queued up, and nvme_tcp_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/tcp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c index 9b81763b44d99..c782005ee99f9 100644 --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -1507,6 +1507,7 @@ static struct blk_mq_tag_set *nvme_tcp_alloc_tagset(struct nvme_ctrl *nctrl, static void nvme_tcp_free_admin_queue(struct nvme_ctrl *ctrl) { if (to_tcp_ctrl(ctrl)->async_req.pdu) { + cancel_work_sync(&ctrl->async_event_work); nvme_tcp_free_async_req(to_tcp_ctrl(ctrl)); to_tcp_ctrl(ctrl)->async_req.pdu = NULL; } -- 2.25.1