OSDN Git Service

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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Jul 2015 16:45:39 +0000 (09:45 -0700)
commit 5fa7dadc898567ce14d6d6d427e7bd8ce6eb5d39 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/talitos.c

index ebbae8d..49374a9 100644 (file)
@@ -2563,6 +2563,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);
        }