HomeFreeBSD

kobj_read_file: Return -1 on vn_rdwr() error

Description

kobj_read_file: Return -1 on vn_rdwr() error

LLVM's static analyzer showed that we could subtract using an
uninitialized value on an error from vn_rdwr().

The correct behavior is to return -1 on an error, so lets do that
instead.

Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #4104

Details

Provenance
Richard Yao <richard.yao@clusterhq.com>Authored on Dec 12 2015, 12:47 AM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Jan 23 2016, 6:16 PM
Parents
rGee42b3d6c3e4: Illumos 1778 - Assertion failed: rn->rn_nozpool == B_FALSE
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG957dc93242bf: kobj_read_file: Return -1 on vn_rdwr() error (authored by Richard Yao <richard.yao@clusterhq.com>).Jan 23 2016, 6:16 PM