diff options
author | eivind <eivind@FreeBSD.org> | 1998-12-15 23:46:59 +0000 |
---|---|---|
committer | eivind <eivind@FreeBSD.org> | 1998-12-15 23:46:59 +0000 |
commit | 3a5b7248f8119ef593f71948e674d802dd7ca853 (patch) | |
tree | 6d6a040c57c83c509a38fe04325398ca715537be /sys/miscfs | |
parent | fac338b16a41db68ed95ba54eb6f6704e0655fdb (diff) | |
download | FreeBSD-src-3a5b7248f8119ef593f71948e674d802dd7ca853.zip FreeBSD-src-3a5b7248f8119ef593f71948e674d802dd7ca853.tar.gz |
Avoid NULL-pointer dereference on error condition.
Diffstat (limited to 'sys/miscfs')
-rw-r--r-- | sys/miscfs/devfs/devfs_vnops.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/miscfs/devfs/devfs_vnops.c b/sys/miscfs/devfs/devfs_vnops.c index de52842..e6857d8 100644 --- a/sys/miscfs/devfs/devfs_vnops.c +++ b/sys/miscfs/devfs/devfs_vnops.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: devfs_vnops.c,v 1.62 1998/10/31 15:31:23 peter Exp $ + * $Id: devfs_vnops.c,v 1.63 1998/12/07 21:58:30 archie Exp $ */ @@ -1529,11 +1529,11 @@ devfs_write( struct vop_write_args *ap) bp = getblk(vp, bn, bsize, 0, 0); else error = bread(vp, bn, bsize, NOCRED, &bp); - n = min(n, bsize - bp->b_resid); if (error) { brelse(bp); return (error); } + n = min(n, bsize - bp->b_resid); error = uiomove((char *)bp->b_data + on, n, uio); if (n + on == bsize) bawrite(bp); |