summaryrefslogtreecommitdiffstats
path: root/sys/geom/vinum
diff options
context:
space:
mode:
authorsobomax <sobomax@FreeBSD.org>2005-11-30 19:24:51 +0000
committersobomax <sobomax@FreeBSD.org>2005-11-30 19:24:51 +0000
commit29543921eae6a40180f2f784021ed1b42d328e2a (patch)
tree81ef73354089000f24e964c7cdffc0035dfe7d01 /sys/geom/vinum
parent937b629bd5f0ccf20166962cb9ec63905573b02c (diff)
downloadFreeBSD-src-29543921eae6a40180f2f784021ed1b42d328e2a.zip
FreeBSD-src-29543921eae6a40180f2f784021ed1b42d328e2a.tar.gz
Check for g_read_data(9) errors properly:
o The only indication of error condition is NULL value returned by the function; o value pointed to by error argument is undefined in the case when operation completes successfully. Discussed with: phk
Diffstat (limited to 'sys/geom/vinum')
-rw-r--r--sys/geom/vinum/geom_vinum_drive.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/geom/vinum/geom_vinum_drive.c b/sys/geom/vinum/geom_vinum_drive.c
index 2cdeb08..519c9f1 100644
--- a/sys/geom/vinum/geom_vinum_drive.c
+++ b/sys/geom/vinum/geom_vinum_drive.c
@@ -453,7 +453,7 @@ gv_drive_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
/* Now check if the provided slice is a valid vinum drive. */
do {
vhdr = g_read_data(cp, GV_HDR_OFFSET, pp->sectorsize, &error);
- if (vhdr == NULL || error != 0)
+ if (vhdr == NULL)
break;
if (vhdr->magic != GV_MAGIC) {
g_free(vhdr);
OpenPOWER on IntegriCloud