diff options
author | sobomax <sobomax@FreeBSD.org> | 2005-11-30 19:24:51 +0000 |
---|---|---|
committer | sobomax <sobomax@FreeBSD.org> | 2005-11-30 19:24:51 +0000 |
commit | 29543921eae6a40180f2f784021ed1b42d328e2a (patch) | |
tree | 81ef73354089000f24e964c7cdffc0035dfe7d01 /sys/geom/vinum | |
parent | 937b629bd5f0ccf20166962cb9ec63905573b02c (diff) | |
download | FreeBSD-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.c | 2 |
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); |