Skip to content
Snippets Groups Projects
Commit a234815c authored by Gaosheng Cui's avatar Gaosheng Cui Committed by Greg Kroah-Hartman
Browse files

crypto: ccree - Remove debugfs when platform_driver_register failed


[ Upstream commit 4f1c596d ]

When platform_driver_register failed, we need to remove debugfs,
which will caused a resource leak, fix it.

Failed logs as follows:
[   32.606488] debugfs: Directory 'ccree' with parent '/' already present!

Fixes: 4c3f9727 ("crypto: ccree - introduce CryptoCell driver")
Signed-off-by: default avatarGaosheng Cui <cuigaosheng1@huawei.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent ca438aa4
No related branches found
No related tags found
No related merge requests found
......@@ -653,9 +653,17 @@ static struct platform_driver ccree_driver = {
static int __init ccree_init(void)
{
int rc;
cc_debugfs_global_init();
return platform_driver_register(&ccree_driver);
rc = platform_driver_register(&ccree_driver);
if (rc) {
cc_debugfs_global_fini();
return rc;
}
return 0;
}
module_init(ccree_init);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment