Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3297394pxk; Mon, 21 Sep 2020 09:59:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+mtfFo/iNgLcLQTtuZ4H+cSFqDQ2Jb0/cYb3oOS1KrP2FzGo/dRtxMfmEY4nMY8E6TFFT X-Received: by 2002:a17:906:b24e:: with SMTP id ce14mr390763ejb.494.1600707595324; Mon, 21 Sep 2020 09:59:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600707595; cv=none; d=google.com; s=arc-20160816; b=F3hCOwugT3+QkM5ntl2rGx5Q75VSQ1DB9fuyOqyE0xT69YE5DuyIZnH61hnosCNjH6 bjrc9YgpTn6fTt/lSll5FW0kGm114VICkY8vQuBf5kcHcevCIm/z7gElSNC+YBtvbDkr L+Tu6uHzkM5Y7dMTJZswIWK4I3V9EqAue2+/KItavJgXCjVW1H61n8Rho5c502Q7magU dh0H4/aJ/L8e73mz0jUHxUH9XYlz2yz3mGwTccDlNXAeZ251lqsyDsWt9aOEip+zlwE2 ir3PHpcdOm29rSytOUUVHw9LecmBc7rTC5oA9ZoiJRry5b2pG3hQnWITtAfjjZB8vngn AD+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=etANKh5JAuNd4QhS6z3QsEaU4jqHmfnqSDYEsLDA7+w=; b=z0RWuDX9tmD39cdWXG3jmwOy78VPs9co3li87l/DZsGoBKMvzF5DbXocb0blPw2pzK dhhaPkjVshxdiAbsB3Xa0KO8bWLmHIiYvZKxI0f7ob9UULPVxbRAmcnxZ20pTb6DJKE1 W/vH/pteElBlW1Cn9BtZGpsd8AlAZgkqzEXy4AErI1Mc3kSepmyRyGW8E9IDuYuutKVt b3c7e0KL+zFYpppwlU95u6x9TMWUxzUcGoC9wxMCIGBVVIYtEssW6z5a3aky1EUEP1Dh AFOIg73Z/3KmhGpIfgLLErAZg6IWAIaUVbjFqHyfG6z4RjdStaZAU+dJWSLklDlQSzhM Oqcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="YGK2A/V2"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q16si8597393ejt.139.2020.09.21.09.59.31; Mon, 21 Sep 2020 09:59:55 -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; dkim=pass header.i=@kernel.org header.s=default header.b="YGK2A/V2"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730027AbgIUQ4d (ORCPT + 99 others); Mon, 21 Sep 2020 12:56:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:50670 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728904AbgIUQo7 (ORCPT ); Mon, 21 Sep 2020 12:44:59 -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 9AF65235F9; Mon, 21 Sep 2020 16:44:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706699; bh=E+rZOxxQzIdF/UYon+OMzY0aLfB7pBon3h1gfjUQuhk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YGK2A/V2vm4ICp7rue393iTuaakYwfeO+TyAhVRC1YPMmqV8J7uO69ymQQAPXdRVo pQIcRk9Pl6DZCOmEcE+CwqntVPW0pr6/54S5KXvCPXvFUvZcciNEgJSJZPN2vHwMIG aLqfE9Gx5EPuXvl32CUGEYppS5T4t0w57VCDBa64= 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.8 028/118] nvme-tcp: cancel async events before freeing event struct Date: Mon, 21 Sep 2020 18:27:20 +0200 Message-Id: <20200921162037.624331191@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162036.324813383@linuxfoundation.org> References: <20200921162036.324813383@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 f1f66bf96cbb9..24467eea73999 100644 --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -1567,6 +1567,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