HomeFreeBSD

Fix QAT allocation failure return value

Description

Fix QAT allocation failure return value

When qat_compress() fails to allocate the required contiguous memory
it mistakenly returns success. This prevents the fallback software
compression from taking over and (un)compressing the block.

Resolve the issue by correctly setting the local 'status' variable
on all exit paths. Furthermore, initialize it to CPA_STATUS_FAIL
to ensure qat_compress() always fails safe to guard against any
similar bugs in the future.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #9784
Closes #9788

Details

Provenance
Brian Behlendorf <behlendorf1@llnl.gov>Authored on Jan 6 2020, 7:17 PM
GitHub <noreply@github.com>Committed on Jan 6 2020, 7:17 PM
Parents
rG581ca28169ea: ZTS: Cleanup partition tables
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rGbc9cef11fddf: Fix QAT allocation failure return value (authored by Brian Behlendorf <behlendorf1@llnl.gov>).Jan 6 2020, 7:17 PM