PERFORCE change 111526 for review

Warner Losh imp at FreeBSD.org
Mon Dec 11 19:28:32 PST 2006


http://perforce.freebsd.org/chv.cgi?CH=111526

Change 111526 by imp at imp_lighthouse on 2006/12/12 03:27:31

	Don't leak a lock on an invalid transfer.

Affected files ...

.. //depot/projects/arm/src/sys/arm/at91/at91_twi.c#39 edit

Differences ...

==== //depot/projects/arm/src/sys/arm/at91/at91_twi.c#39 (text+ko) ====

@@ -321,8 +321,10 @@
 		len = msgs[i].len;
 		buf = msgs[i].buf;
 		/* zero byte transfers aren't allowed */
-		if (len == 0 || buf == NULL)
-			return (EINVAL);
+		if (len == 0 || buf == NULL) {
+			err = EINVAL;
+			goto out;
+		}
 		if (len == 1)
 			WR4(sc, TWI_CR, TWI_CR_START | TWI_CR_STOP);
 		else


More information about the p4-projects mailing list