summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPedro Martelletto <pedro@cvs.openbsd.org>2005-05-15 21:26:20 +0000
committerPedro Martelletto <pedro@cvs.openbsd.org>2005-05-15 21:26:20 +0000
commit173eb6afe5819a3c0582841091b7b6134fb6decf (patch)
tree95a0217ce42606d3982a11e7502e5d8f15f6550f /sys
parent50972e71ac72c4e624b350ed4e5fa125454d2667 (diff)
in udf_vget(), release the buffer if a bread() fails
Diffstat (limited to 'sys')
-rw-r--r--sys/isofs/udf/udf_vfsops.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/isofs/udf/udf_vfsops.c b/sys/isofs/udf/udf_vfsops.c
index 9516bf296b4..63dc5eae75d 100644
--- a/sys/isofs/udf/udf_vfsops.c
+++ b/sys/isofs/udf/udf_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udf_vfsops.c,v 1.2 2005/03/30 00:56:19 pedro Exp $ */
+/* $OpenBSD: udf_vfsops.c,v 1.3 2005/05/15 21:26:19 pedro Exp $ */
/*
* Copyright (c) 2001, 2002 Scott Long <scottl@freebsd.org>
@@ -624,6 +624,7 @@ udf_vget(struct mount *mp, ino_t ino, struct vnode **vpp)
int error, sector, size;
p = curproc;
+ bp = NULL;
*vpp = NULL;
udfmp = VFSTOUDFFS(mp);
@@ -648,6 +649,8 @@ udf_vget(struct mount *mp, ino_t ino, struct vnode **vpp)
if ((error = RDSECTOR(devvp, sector, udfmp->bsize, &bp)) != 0) {
printf("Cannot read sector %d\n", sector);
pool_put(&udf_node_pool, unode);
+ if (bp != NULL)
+ brelse(bp);
return (error);
}