Commit 256e4db4 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Zhang Zekun
Browse files

crypto: caam - Fix the pointer passed to caam_qi_shutdown()

stable inclusion
from stable-v5.10.231
commit cc386170b3312fd7b5bc4a69a9f52d7f50814526
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBEGFF
CVE: CVE-2024-56754

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=cc386170b3312fd7b5bc4a69a9f52d7f50814526



--------------------------------

[ Upstream commit ad980b04f51f7fb503530bd1cb328ba5e75a250e ]

The type of the last parameter given to devm_add_action_or_reset() is
"struct caam_drv_private *", but in caam_qi_shutdown(), it is casted to
"struct device *".

Pass the correct parameter to devm_add_action_or_reset() so that the
resources are released as expected.

Fixes: f414de2e ("crypto: caam - use devres to de-initialize QI")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZhang Zekun <zhangzekun11@huawei.com>
parent d87fcf95
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -768,7 +768,7 @@ int caam_qi_init(struct platform_device *caam_pdev)

	caam_debugfs_qi_init(ctrlpriv);

	err = devm_add_action_or_reset(qidev, caam_qi_shutdown, ctrlpriv);
	err = devm_add_action_or_reset(qidev, caam_qi_shutdown, qidev);
	if (err)
		return err;