crypto: testmgr - Set err before proceeding
authorSalvatore Benedetto <salvatore.benedetto@intel.com>
Mon, 4 Jul 2016 09:52:34 +0000 (10:52 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 5 Jul 2016 15:05:22 +0000 (23:05 +0800)
Report correct error in case of failure

Signed-off-by: Salvatore Benedetto <salvatore.benedetto@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/testmgr.c

index 8ea0d3f..769cc2a 100644 (file)
@@ -1941,6 +1941,7 @@ static int test_akcipher_one(struct crypto_akcipher *tfm,
        if (err)
                goto free_req;
 
+       err = -ENOMEM;
        out_len_max = crypto_akcipher_maxsize(tfm);
        outbuf_enc = kzalloc(out_len_max, GFP_KERNEL);
        if (!outbuf_enc)