diff mbox series

[v3,07/12] test: dm: virtio: Test notify before del_vqs

Message ID 20220516104140.1047229-8-ascull@google.com
State Accepted
Commit 82c8610a44c6d4d38b90246f6893cb8e7b911e0c
Delegated to: Tom Rini
Headers show
Series virtio: Harden and test vring | expand

Commit Message

Andrew Scull May 16, 2022, 10:41 a.m. UTC
The virtqueue is passed to virtio_notify() so move the virtqueue
deletion to the end of the test when it's no longer needed. This wasn't
causing any problems because the sandbox virtio transport driver doesn't
do anything for notifications, but it could cause problems if things
change and it was a bad example.

Signed-off-by: Andrew Scull <ascull@google.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
 test/dm/virtio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/test/dm/virtio.c b/test/dm/virtio.c
index aa4e3d778e..ff1dea323c 100644
--- a/test/dm/virtio.c
+++ b/test/dm/virtio.c
@@ -80,8 +80,8 @@  static int dm_test_virtio_all_ops(struct unit_test_state *uts)
 	ut_asserteq_64(BIT_ULL(VIRTIO_F_VERSION_1), features);
 	ut_assertok(virtio_set_features(dev));
 	ut_assertok(virtio_find_vqs(dev, nvqs, vqs));
-	ut_assertok(virtio_del_vqs(dev));
 	ut_assertok(virtio_notify(dev, vqs[0]));
+	ut_assertok(virtio_del_vqs(dev));
 
 	return 0;
 }