From: Benjamin Berg Date: Thu, 9 Feb 2023 09:00:03 +0000 (+0100) Subject: um: virtio_uml: mark device as unregistered when breaking it X-Git-Tag: v6.1.21~496 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1954d3cd49d357146b99e38eee874f281fed4bfb;p=platform%2Fkernel%2Flinux-starfive.git um: virtio_uml: mark device as unregistered when breaking it [ Upstream commit 8e9cd85139a2149d5a7c121b05e0cdb8287311f9 ] Mark the device as not registered anymore when scheduling the work to remove it. Otherwise we could end up scheduling the work multiple times in a row, including scheduling it while it is already running. Fixes: af9fb41ed315 ("um: virtio_uml: Fix broken device handling in time-travel") Signed-off-by: Benjamin Berg Signed-off-by: Richard Weinberger Signed-off-by: Sasha Levin --- diff --git a/arch/um/drivers/virtio_uml.c b/arch/um/drivers/virtio_uml.c index 588930a..dcfd0ca 100644 --- a/arch/um/drivers/virtio_uml.c +++ b/arch/um/drivers/virtio_uml.c @@ -168,6 +168,8 @@ static void vhost_user_check_reset(struct virtio_uml_device *vu_dev, if (!vu_dev->registered) return; + vu_dev->registered = 0; + virtio_break_device(&vu_dev->vdev); schedule_work(&pdata->conn_broken_wk); }