svn commit: r191310 - head/sys/dev/sound/pci

Stanislav Sedov stas at FreeBSD.org
Mon Apr 20 13:15:26 UTC 2009


Author: stas
Date: Mon Apr 20 13:15:25 2009
New Revision: 191310
URL: http://svn.freebsd.org/changeset/base/191310

Log:
  - Unlock softc mutex on failure.
  
  MFC after:	1 week

Modified:
  head/sys/dev/sound/pci/envy24ht.c

Modified: head/sys/dev/sound/pci/envy24ht.c
==============================================================================
--- head/sys/dev/sound/pci/envy24ht.c	Mon Apr 20 12:59:23 2009	(r191309)
+++ head/sys/dev/sound/pci/envy24ht.c	Mon Apr 20 13:15:25 2009	(r191310)
@@ -1677,6 +1677,7 @@ envy24htchan_trigger(kobj_t obj, void *d
 	struct sc_info *sc = ch->parent;
 	u_int32_t ptr;
 	int slot;
+	int error = 0;
 #if 0
 	int i;
 
@@ -1698,8 +1699,10 @@ envy24htchan_trigger(kobj_t obj, void *d
 			sc->caps[0].minspeed = sc->caps[0].maxspeed = sc->speed;
 			sc->caps[1].minspeed = sc->caps[1].maxspeed = sc->speed;
 		}
-		else if (ch->speed != 0 && ch->speed != sc->speed)
-			return -1;
+		else if (ch->speed != 0 && ch->speed != sc->speed) {
+			error = -1;
+			goto fail;
+		}
 		if (ch->speed == 0)
 			ch->channel->speed = sc->speed;
 		/* start or enable channel */
@@ -1729,16 +1732,20 @@ envy24htchan_trigger(kobj_t obj, void *d
 #if(0)
 		device_printf(sc->dev, "envy24htchan_trigger(): emldmawr\n");
 #endif
-		if (ch->run != 1)
-			return -1;
+		if (ch->run != 1) {
+			error = -1;
+			goto fail;
+		}
 		ch->emldma(ch);
 		break;
 	case PCMTRIG_EMLDMARD:
 #if(0)
 		device_printf(sc->dev, "envy24htchan_trigger(): emldmard\n");
 #endif
-		if (ch->run != 1)
-			return -1;
+		if (ch->run != 1) {
+			error = -1;
+			goto fail;
+		}
 		ch->emldma(ch);
 		break;
 	case PCMTRIG_ABORT:
@@ -1768,9 +1775,9 @@ envy24htchan_trigger(kobj_t obj, void *d
 		}
 		break;
 	}
+fail:
 	snd_mtxunlock(sc->lock);
-
-	return 0;
+	return (error);
 }
 
 static int


More information about the svn-src-head mailing list