mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
fsl/fman: Free init resources on KeyGen failure in fman_init()
commitd288efa2b9upstream. fman_muram_alloc() allocates initialization resources before initializing the KeyGen block. If keygen_init() fails, the function returns -EINVAL directly and leaves those resources allocated. Free the initialization resources before returning from the KeyGen failure path. Fixes:7472f4f281("fsl/fman: enable FMan Keygen") Cc: stable@kernel.org Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com> Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com> Reviewed-by: Breno Leitao <leitao@debian.org> Link: https://patch.msgid.link/20260625004834.3394389-1-haoxiang_li2024@163.com Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e7fd81e9fb
commit
ffb13fe194
@@ -1995,8 +1995,10 @@ static int fman_init(struct fman *fman)
|
||||
|
||||
/* Init KeyGen */
|
||||
fman->keygen = keygen_init(fman->kg_regs);
|
||||
if (!fman->keygen)
|
||||
if (!fman->keygen) {
|
||||
free_init_resources(fman);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
err = enable(fman, cfg);
|
||||
if (err != 0)
|
||||
|
||||
Reference in New Issue
Block a user