⬢ DragonFlyBSD Kernel Audit
DF-3951 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/raid/mlx/mlx.c
+++ b/sys/dev/raid/mlx/mlx.c
@@ -2104,9 +2104,12 @@
      * We couldn't get the controller to take the command.  Revoke the slot
      * that the command was given and return it with a bad status.
      */
-    sc->mlx_busycmd[mc->mc_slot] = NULL;
-    device_printf(sc->mlx_dev, "controller wedged (not taking commands)\n");
-    mc->mc_status = MLX_STATUS_WEDGED;
+    sc->mlx_busycmd[mc->mc_slot] = NULL;
+	crit_enter();
+	sc->mlx_busycmds--;		/* keep slot accounting balanced */
+	crit_exit();
+    device_printf(sc->mlx_dev, "controller wedged (not taking commands)\n");
+    mc->mc_status = MLX_STATUS_WEDGED;
     mlx_complete(sc);
     return(EIO);
 }