Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Nov 2012 05:58:52 +0000 (UTC)
From:      Kevin Lo <kevlo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r242947 - head/sys/dev/iicbus
Message-ID:  <201211130558.qAD5wqOc093267@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevlo
Date: Tue Nov 13 05:58:52 2012
New Revision: 242947
URL: http://svnweb.freebsd.org/changeset/base/242947

Log:
  Check the return value of uiomove(9).

Modified:
  head/sys/dev/iicbus/iic.c

Modified: head/sys/dev/iicbus/iic.c
==============================================================================
--- head/sys/dev/iicbus/iic.c	Tue Nov 13 03:56:50 2012	(r242946)
+++ head/sys/dev/iicbus/iic.c	Tue Nov 13 05:58:52 2012	(r242947)
@@ -221,7 +221,11 @@ iicwrite(struct cdev *dev, struct uio * 
 	}
 
 	count = min(uio->uio_resid, BUFSIZE);
-	uiomove(sc->sc_buffer, count, uio);
+	error = uiomove(sc->sc_buffer, count, uio);
+	if (error) {
+		IIC_UNLOCK(sc);
+		return (error);
+	}
 
 	error = iicbus_block_write(device_get_parent(iicdev), sc->sc_addr,
 					sc->sc_buffer, count, &sent);



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