]> git.baikalelectronics.ru Git - kernel.git/commitdiff
nvme-tcp: cancel async events before freeing event struct
authorDavid Milburn <dmilburn@redhat.com>
Wed, 2 Sep 2020 22:42:53 +0000 (17:42 -0500)
committerChristoph Hellwig <hch@lst.de>
Tue, 8 Sep 2020 17:46:29 +0000 (19:46 +0200)
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 <dmilburn@redhat.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/tcp.c

index 873d6afcbc9ee97b7a874d268a7c9707c783f514..245a73d0a1caff06b206c6998df16374a965e721 100644 (file)
@@ -1597,6 +1597,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;
        }