Commit e6c0effa authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

mic_virtio: fix a timeout loop

After the loop we test "if (!retry)" to see if we timedout.  The problem
is "retry--" is a post-op so retry will be -1 at the end of the loop.  I
have fixed this by changing it to a pre-op instead.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f38e87e8
...@@ -337,7 +337,7 @@ static int mic_find_vqs(struct virtio_device *vdev, unsigned nvqs, ...@@ -337,7 +337,7 @@ static int mic_find_vqs(struct virtio_device *vdev, unsigned nvqs,
* rings have been re-assigned. * rings have been re-assigned.
*/ */
mic_send_intr(mvdev->mdev, mvdev->c2h_vdev_db); mic_send_intr(mvdev->mdev, mvdev->c2h_vdev_db);
for (retry = 100; retry--;) { for (retry = 100; --retry;) {
if (!ioread8(&dc->used_address_updated)) if (!ioread8(&dc->used_address_updated))
break; break;
msleep(100); msleep(100);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment