From: Horia Geant? Date: Mon, 11 May 2015 17:03:24 +0000 (+0300) Subject: crypto: talitos - avoid memleak in talitos_alg_alloc() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5fa7dadc898567ce14d6d6d427e7bd8ce6eb5d39;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git crypto: talitos - avoid memleak in talitos_alg_alloc() Cc: # 3.2+ Fixes: 1d11911a8c57 ("crypto: talitos - fix warning: 'alg' may be used uninitialized in this function") Signed-off-by: Horia Geanta Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index aaa7af856b39..73a400483696 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c @@ -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); }