summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/nx
diff options
context:
space:
mode:
authorDan Streetman2015-07-30 01:42:09 +0200
committerHerbert Xu2015-07-30 15:49:40 +0200
commit7371c0a5c205455d69f8e8dc1d16791f08a38155 (patch)
tree194bd4310919ede1b2e8c2c2a14b7ac2ea75727b /drivers/crypto/nx
parentcrypto: qat - remove unnecessary list iteration (diff)
downloadkernel-qcow2-linux-7371c0a5c205455d69f8e8dc1d16791f08a38155.tar.gz
kernel-qcow2-linux-7371c0a5c205455d69f8e8dc1d16791f08a38155.tar.xz
kernel-qcow2-linux-7371c0a5c205455d69f8e8dc1d16791f08a38155.zip
crypto: nx - don't err if compressed output > input
Return success instead of error if compression succeeds but the output is larger than the input. It's unlikely that the caller will use the compressed data since it's larger than the original uncompressed data, but there was no error and returning an error code is incorrect. Further, for testing small input buffers, the output is likely to be larger than the input and success needs to be returned to verify the test. Signed-off-by: Dan Streetman <ddstreet@ieee.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/nx')
-rw-r--r--drivers/crypto/nx/nx-842-pseries.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/crypto/nx/nx-842-pseries.c b/drivers/crypto/nx/nx-842-pseries.c
index b6a26907e11f..f4cbde03c6ad 100644
--- a/drivers/crypto/nx/nx-842-pseries.c
+++ b/drivers/crypto/nx/nx-842-pseries.c
@@ -226,9 +226,12 @@ static int nx842_validate_result(struct device *dev,
switch (csb->completion_code) {
case 0: /* Completed without error */
break;
- case 64: /* Target bytes > Source bytes during compression */
+ case 64: /* Compression ok, but output larger than input */
+ dev_dbg(dev, "%s: output size larger than input size\n",
+ __func__);
+ break;
case 13: /* Output buffer too small */
- dev_dbg(dev, "%s: Compression output larger than input\n",
+ dev_dbg(dev, "%s: Out of space in output buffer\n",
__func__);
return -ENOSPC;
case 66: /* Input data contains an illegal template field */