Fix a leak where a scratch buffer was not freed when reading from the

/dev/?random devices.  This appears to have been missed when the code
was brought across from the i386.  (This should fix the "world build
hangs with everything waiting on 'temp' problem.)

Also add some iovec fixup code in the error path which seems to have
been similarly fixed.

There are a number of other differences between the i386 and alpha
version which have not been examined.  This code should still be
considered suspect.
This commit is contained in:
Mike Smith 2000-05-13 05:38:25 +00:00
parent 64cb419d61
commit 6d7d302695
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=60494

View File

@ -297,7 +297,15 @@ kmemphys:
default:
return (ENXIO);
}
if (error)
break;
iov->iov_base += c;
iov->iov_len -= c;
uio->uio_offset += c;
uio->uio_resid -= c;
}
if (buf)
free(buf, M_TEMP);
return (error);
}