ALSA: xen-front: fix a loop timeout
authorDan Carpenter <[email protected]>
Thu, 31 May 2018 06:25:07 +0000 (09:25 +0300)
committerTakashi Iwai <[email protected]>
Thu, 31 May 2018 07:11:03 +0000 (09:11 +0200)
We want the loop to exit when "to" is set to zero, but in the current
code it's set to -1.  Also I tweaked the indenting so it doesn't look
like we're passing "--to" to xenbus_read_unsigned().

Fixes: cc3196ae197c ("ALSA: xen-front: Introduce Xen para-virtualized sound frontend driver")
Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: Oleksandr Andrushchenko <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
sound/xen/xen_snd_front.c

index c18973a9bc9bf509bef879d0e40d48c5f501a2e7..b089b13b51607c2df673f936efb37ff681b382e1 100644 (file)
@@ -334,7 +334,7 @@ static int xen_drv_remove(struct xenbus_device *dev)
         */
        while ((xenbus_read_unsigned(front_info->xb_dev->otherend, "state",
                                     XenbusStateUnknown) != XenbusStateInitWait) &&
-                                    to--)
+              --to)
                msleep(10);
 
        if (!to) {