Commit 20fc311f authored by Dan Streetman's avatar Dan Streetman Committed by Herbert Xu

crypto: nx - use common code for both NX decompress success cases

Replace the duplicated finishing code (set destination buffer length and
set return code to 0) in the case of decompressing a buffer with no header
with a goto to the success case of decompressing a buffer with a header.

This is a trivial change that allows both success cases to use common code,
and includes the pr_debug() msg in both cases as well.
Signed-off-by: default avatarDan Streetman <ddstreet@ieee.org>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent ee781b7f
...@@ -520,10 +520,7 @@ static int nx842_crypto_decompress(struct crypto_tfm *tfm, ...@@ -520,10 +520,7 @@ static int nx842_crypto_decompress(struct crypto_tfm *tfm,
if (ret) if (ret)
goto unlock; goto unlock;
*dlen = p.ototal; goto success;
ret = 0;
goto unlock;
} }
if (!hdr->groups) { if (!hdr->groups) {
...@@ -557,6 +554,7 @@ static int nx842_crypto_decompress(struct crypto_tfm *tfm, ...@@ -557,6 +554,7 @@ static int nx842_crypto_decompress(struct crypto_tfm *tfm,
goto unlock; goto unlock;
} }
success:
*dlen = p.ototal; *dlen = p.ototal;
pr_debug("decompress total slen %x dlen %x\n", slen, *dlen); pr_debug("decompress total slen %x dlen %x\n", slen, *dlen);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment