From 59909a9c54adeb4233d799044d42c2db4565c67d Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Fri, 6 Aug 2010 00:00:42 +0000 Subject: Every time you ignore uiomove() return value, $DEITY kills a little $ADORABLE_FELINE. ok deraadt@ matthew@ --- sys/dev/ic/lpt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sys/dev/ic/lpt.c') diff --git a/sys/dev/ic/lpt.c b/sys/dev/ic/lpt.c index 9f7ba6cb891..4d2b1b50eb2 100644 --- a/sys/dev/ic/lpt.c +++ b/sys/dev/ic/lpt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lpt.c,v 1.6 2010/06/26 23:24:44 guenther Exp $ */ +/* $OpenBSD: lpt.c,v 1.7 2010/08/06 00:00:41 miod Exp $ */ /* $NetBSD: lpt.c,v 1.42 1996/10/21 22:41:14 thorpej Exp $ */ /* @@ -373,7 +373,9 @@ lptwrite(dev, uio, flags) int error = 0; while ((n = min(LPT_BSIZE, uio->uio_resid)) != 0) { - uiomove(sc->sc_cp = sc->sc_inbuf->b_data, n, uio); + error = uiomove(sc->sc_cp = sc->sc_inbuf->b_data, n, uio); + if (error != 0) + return error; sc->sc_count = n; error = lptpushbytes(sc); if (error) { -- cgit v1.2.3