crypto: talitos - avoid memleak in talitos_alg_alloc()
authorHoria Geant? <horia.geanta@freescale.com>
Mon, 11 May 2015 17:03:24 +0000 (20:03 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 13 May 2015 02:31:56 +0000 (10:31 +0800)
Cc: <stable@vger.kernel.org> # 3.2+
Fixes: 1d11911a8c57 ("crypto: talitos - fix warning: 'alg' may be used uninitialized in this function")
Signed-off-by: Horia Geanta <horia.geanta@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/talitos.c

index aaa7af856b39890be1b2b2ba9a5fb178bb5fb171..73a400483696efd94c86c4ee48dd5f8a5320b962 100644 (file)
@@ -2813,6 +2813,7 @@ static struct talitos_crypto_alg *talitos_alg_alloc(struct device *dev,
                break;
        default:
                dev_err(dev, "unknown algorithm type %d\n", t_alg->algt.type);
+               kfree(t_alg);
                return ERR_PTR(-EINVAL);
        }