fs: Can't use store behind data if pioctl errored

If the call to a pioctl returns an error, it's possible to reach
the end of the storebehind function and try and print an old, or
bogus, value from the pioctl data block.

Caught by clang-analyzer

Change-Id: I1209c0c24730273510fbad98a75a429917836605
Reviewed-on: http://gerrit.openafs.org/2142
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
Simon Wilkinson 2010-06-12 10:35:34 +01:00 committed by Derrick Brashear
parent 6dd07af215
commit 904c9fbeba

View File

@ -3341,7 +3341,7 @@ StoreBehindCmd(struct cmd_syndesc *as, void *arock)
}
/* Having no arguments also reports the default store asynchrony */
if (verbose && (blob.out_size == sizeof(tsb2))) {
if (!error && verbose && (blob.out_size == sizeof(tsb2))) {
fprintf(stdout, "Default store asynchrony is %d kbytes.\n",
(tsb2.sb_default / 1024));
}