Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Fix infinite loop in dwc_mmc_exec_command error path



details:   https://anonhg.NetBSD.org/src/rev/1a79d88d9ee4
branches:  trunk
changeset: 452937:1a79d88d9ee4
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Jul 28 10:30:44 2019 +0000

description:
Fix infinite loop in dwc_mmc_exec_command error path

diffstat:

 sys/dev/ic/dwc_mmc.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 0a0944a36315 -r 1a79d88d9ee4 sys/dev/ic/dwc_mmc.c
--- a/sys/dev/ic/dwc_mmc.c      Sun Jul 28 10:29:49 2019 +0000
+++ b/sys/dev/ic/dwc_mmc.c      Sun Jul 28 10:30:44 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_mmc.c,v 1.16 2019/04/30 23:19:55 jmcneill Exp $ */
+/* $NetBSD: dwc_mmc.c,v 1.17 2019/07/28 10:30:44 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dwc_mmc.c,v 1.16 2019/04/30 23:19:55 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc_mmc.c,v 1.17 2019/07/28 10:30:44 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -625,7 +625,7 @@
                                    DWC_MMC_IDST_ERROR | DWC_MMC_IDST_COMPLETE;
                                retry = 10;
                                while ((sc->sc_idma_idst & idst_mask) == 0) {
-                                       if (retry == 0) {
+                                       if (--retry == 0) {
                                                cmd->c_error = ETIMEDOUT;
                                                break;
                                        }



Home | Main Index | Thread Index | Old Index