]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: hisilicon/hpre - fix memory leak in hpre_curve25519_src_init()
authorWeili Qian <qianweili@huawei.com>
Sat, 11 Dec 2021 08:17:19 +0000 (16:17 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 17 Dec 2021 05:59:48 +0000 (16:59 +1100)
commit7f7e856a5e3a2ff9f520256585465ab0db206a32
treed8cdd092c855ed59eb824ff86817a8e205b9422f
parent5a7f9c4ec5432cd6cf0bedc2212ca63d250dd418
crypto: hisilicon/hpre - fix memory leak in hpre_curve25519_src_init()

hpre_curve25519_src_init() allocates memory for 'ptr' before calling
memcmp(). If memcmp() returns 0, the function will return '-EINVAL'
without freeing memory.

Signed-off-by: Weili Qian <qianweili@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/hisilicon/hpre/hpre_crypto.c