Skip to content

Commit 7bb5fb2

Browse files
YongjiXiemstsirkin
authored andcommitted
vduse: Cleanup the old kernel states after reset failure
We should cleanup the old kernel states e.g. interrupt callback no matter whether the userspace handle the reset correctly or not since virtio-vdpa can't handle the reset failure now. Otherwise, the old state might be used after reset which might break something, e.g. the old interrupt callback might be triggered by userspace after reset, which can break the virtio device driver. Signed-off-by: Xie Yongji <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michael S. Tsirkin <[email protected]> Acked-by: Jason Wang <[email protected]>
1 parent 6243e3c commit 7bb5fb2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/vdpa/vdpa_user/vduse_dev.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -665,13 +665,11 @@ static void vduse_vdpa_set_config(struct vdpa_device *vdpa, unsigned int offset,
665665
static int vduse_vdpa_reset(struct vdpa_device *vdpa)
666666
{
667667
struct vduse_dev *dev = vdpa_to_vduse(vdpa);
668-
669-
if (vduse_dev_set_status(dev, 0))
670-
return -EIO;
668+
int ret = vduse_dev_set_status(dev, 0);
671669

672670
vduse_dev_reset(dev);
673671

674-
return 0;
672+
return ret;
675673
}
676674

677675
static u32 vduse_vdpa_get_generation(struct vdpa_device *vdpa)

0 commit comments

Comments
 (0)