* If the result of the compression has the same size as the input, it's
also useless; not only when it's bigger.
* This seems to fix several issues with consumers that would send the
data out without noting that compression was used.
Obtained-from: FreeBSD
sw->sw_size = result;
/* Check the compressed size when doing compression */
if (crd->crd_flags & CRD_F_COMP) {
- if (result > crd->crd_len) {
+ if (result >= crd->crd_len) {
/* Compression was useless, we lost time */
kfree(out, M_CRYPTO_DATA);
return 0;