summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorbp <bp@FreeBSD.org>1999-12-28 16:14:54 +0000
committerbp <bp@FreeBSD.org>1999-12-28 16:14:54 +0000
commit4e45fd34493f7dae6d001a4801f163c4a9119684 (patch)
tree3b5a82436e9a18680ff29120fab242a61677abd7 /sys/fs
parent5f346bab48d27ee52d2e0fdd4d06d29baa316d73 (diff)
downloadFreeBSD-src-4e45fd34493f7dae6d001a4801f163c4a9119684.zip
FreeBSD-src-4e45fd34493f7dae6d001a4801f163c4a9119684.tar.gz
Avoid to write garbage if uiomove fails.
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/msdosfs/msdosfs_vnops.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c
index 3ad5135..d72a4cd 100644
--- a/sys/fs/msdosfs/msdosfs_vnops.c
+++ b/sys/fs/msdosfs/msdosfs_vnops.c
@@ -780,6 +780,10 @@ msdosfs_write(ap)
* Copy the data from user space into the buf header.
*/
error = uiomove(bp->b_data + croffset, n, uio);
+ if (error) {
+ brelse(bp);
+ break;
+ }
/*
* If they want this synchronous then write it and wait for
OpenPOWER on IntegriCloud