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/geom_aes.c | |
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/geom_aes.c')
-rw-r--r-- | sys/geom/geom_aes.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/geom/geom_aes.c b/sys/geom/geom_aes.c index de7e1c6..e0b414b 100644 --- a/sys/geom/geom_aes.c +++ b/sys/geom/geom_aes.c @@ -300,7 +300,7 @@ g_aes_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) sectorsize = cp->provider->sectorsize; mediasize = cp->provider->mediasize; buf = g_read_data(cp, 0, sectorsize, &error); - if (buf == NULL || error != 0) { + if (buf == NULL) { break; } sc = g_malloc(sizeof(struct g_aes_softc), M_WAITOK | M_ZERO); |