svn commit: r223174 - stable/8/sys/dev/led
Alexander Motin
mav at FreeBSD.org
Fri Jun 17 06:17:46 UTC 2011
Author: mav
Date: Fri Jun 17 06:17:45 2011
New Revision: 223174
URL: http://svn.freebsd.org/changeset/base/223174
Log:
MFC r212371 (by mdf):
Fix an incorrect use of sbuf_overflowed() after a call to sbuf_finish().
Modified:
stable/8/sys/dev/led/led.c
Directory Properties:
stable/8/sys/ (props changed)
stable/8/sys/amd64/include/xen/ (props changed)
stable/8/sys/cddl/contrib/opensolaris/ (props changed)
stable/8/sys/contrib/dev/acpica/ (props changed)
stable/8/sys/contrib/pf/ (props changed)
Modified: stable/8/sys/dev/led/led.c
==============================================================================
--- stable/8/sys/dev/led/led.c Fri Jun 17 06:12:28 2011 (r223173)
+++ stable/8/sys/dev/led/led.c Fri Jun 17 06:17:45 2011 (r223174)
@@ -220,15 +220,11 @@ led_write(struct cdev *dev, struct uio *
free(s2, M_DEVBUF);
return (EINVAL);
}
- sbuf_finish(sb);
+ error = sbuf_finish(sb);
free(s2, M_DEVBUF);
- if (sbuf_overflowed(sb)) {
+ if (error != 0 || sbuf_len(sb) == 0) {
sbuf_delete(sb);
- return (ENOMEM);
- }
- if (sbuf_len(sb) == 0) {
- sbuf_delete(sb);
- return (0);
+ return (error);
}
return (led_state(dev, sb, 0));
More information about the svn-src-stable
mailing list