caam_remove already removes the debugfs entry, so we need to remove the one
immediately before calling caam_remove.

This fix a NULL dereference at error paths is caam_probe fail.

Fixes: 67c2315def06 ("crypto: caam - add Queue Interface (QI) backend support")

Tested-by: Ryan Harkin <ryan.har...@linaro.org>
Cc: "Horia Geantă" <horia.gea...@nxp.com>
Cc: Aymen Sghaier <aymen.sgha...@nxp.com>
Cc: Fabio Estevam <fabio.este...@nxp.com>
Cc: Peng Fan <peng....@nxp.com>
Cc: "David S. Miller" <da...@davemloft.net>
Cc: Lukas Auer <lukas.a...@aisec.fraunhofer.de>
Cc: <sta...@vger.kernel.org> # 4.12+
Reviewed-by: Horia Geantă <horia.gea...@nxp.com>
Signed-off-by: Rui Miguel Silva <rui.si...@linaro.org>
---
 drivers/crypto/caam/ctrl.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c
index e843cf410373..361e750f9cba 100644
--- a/drivers/crypto/caam/ctrl.c
+++ b/drivers/crypto/caam/ctrl.c
@@ -815,9 +815,6 @@ static int caam_probe(struct platform_device *pdev)
        return 0;
 
 caam_remove:
-#ifdef CONFIG_DEBUG_FS
-       debugfs_remove_recursive(ctrlpriv->dfs_root);
-#endif
        caam_remove(pdev);
        return ret;
 
-- 
2.16.2

Reply via email to