Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Jun 2011 06:17:45 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r223174 - stable/8/sys/dev/led
Message-ID:  <201106170617.p5H6HjBV063744@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106170617.p5H6HjBV063744>