crypto: sa2ul - stop probe if context pool creation fails

sa_ul_probe() calls sa_init_mem() to create the DMA pool used for
security context buffers, but ignores its return value. If pool creation
fails, probe still continues with DMA setup, algorithm registration and
child population even though later request setup depends on that pool.

Stop probing when sa_init_mem() fails, and route that failure to the PM
cleanup path without attempting to destroy an uncreated DMA pool.

Fixes: 7694b6ca64 ("crypto: sa2ul - Add crypto driver")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Pengpeng Hou 2026-06-16 08:46:27 +08:00 committed by Herbert Xu
parent e9d76cd90c
commit d03f980a25

View File

@ -2395,7 +2395,10 @@ static int sa_ul_probe(struct platform_device *pdev)
return ret;
}
sa_init_mem(dev_data);
ret = sa_init_mem(dev_data);
if (ret)
goto disable_pm;
ret = sa_dma_init(dev_data);
if (ret)
goto destroy_dma_pool;
@ -2430,6 +2433,7 @@ static int sa_ul_probe(struct platform_device *pdev)
destroy_dma_pool:
dma_pool_destroy(dev_data->sc_pool);
disable_pm:
pm_runtime_put_sync(dev);
pm_runtime_disable(dev);