Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/sys/kern Pull up revision 1.62 (via patch, requested by...



details:   https://anonhg.NetBSD.org/src/rev/13e32a20cb71
branches:  netbsd-1-5
changeset: 493016:13e32a20cb71
user:      he <he%NetBSD.org@localhost>
date:      Thu Mar 28 22:49:02 2002 +0000

description:
Pull up revision 1.62 (via patch, requested by jdolecek):
  Make sure file descriptor is properly FILE_UNUSE()d in error case
  of writev.

diffstat:

 sys/kern/sys_generic.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (22 lines):

diff -r 8b786b4f2856 -r 13e32a20cb71 sys/kern/sys_generic.c
--- a/sys/kern/sys_generic.c    Thu Mar 28 22:45:59 2002 +0000
+++ b/sys/kern/sys_generic.c    Thu Mar 28 22:49:02 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sys_generic.c,v 1.48.4.2 2001/12/24 14:05:28 he Exp $  */
+/*     $NetBSD: sys_generic.c,v 1.48.4.3 2002/03/28 22:49:02 he Exp $  */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -431,8 +431,10 @@
        /* note: can't use iovlen until iovcnt is validated */
        iovlen = iovcnt * sizeof(struct iovec);
        if ((u_int)iovcnt > UIO_SMALLIOV) {
-               if ((u_int)iovcnt > IOV_MAX)
-                       return (EINVAL);
+               if ((u_int)iovcnt > IOV_MAX) {
+                       error = EINVAL;
+                       goto out;
+               }
                MALLOC(iov, struct iovec *, iovlen, M_IOV, M_WAITOK);
                needfree = iov;
        } else if ((u_int)iovcnt > 0) {



Home | Main Index | Thread Index | Old Index