summaryrefslogtreecommitdiffstats
path: root/drivers/misc/mic
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-12-15 11:11:28 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-08 07:53:40 +0100
commite6c0effa0e4dd17b4569bb62eaf6283033d475a4 (patch)
tree05e9f83b67b2f4e064dd3cdb8e0a894347cf8534 /drivers/misc/mic
parentmisc: mic: Fix crash when MIC reset is invoked in RESET_FAILED state (diff)
downloadlinux-e6c0effa0e4dd17b4569bb62eaf6283033d475a4.tar.xz
linux-e6c0effa0e4dd17b4569bb62eaf6283033d475a4.zip
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: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mic')
-rw-r--r--drivers/misc/mic/card/mic_virtio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/mic/card/mic_virtio.c b/drivers/misc/mic/card/mic_virtio.c
index f6ed57d3125c..17764b2fbee5 100644
--- a/drivers/misc/mic/card/mic_virtio.c
+++ b/drivers/misc/mic/card/mic_virtio.c
@@ -337,7 +337,7 @@ static int mic_find_vqs(struct virtio_device *vdev, unsigned nvqs,
* rings have been re-assigned.
*/
mic_send_intr(mvdev->mdev, mvdev->c2h_vdev_db);
- for (retry = 100; retry--;) {
+ for (retry = 100; --retry;) {
if (!ioread8(&dc->used_address_updated))
break;
msleep(100);