[RESEND,1/6] crypto: caam: Fix null dereference at error path

Message ID 1516805435-15034-2-git-send-email-pure.logic@nexus-software.ie
State New
Headers show
  • [RESEND,1/6] crypto: caam: Fix null dereference at error path
Related show

Commit Message

Bryan O'Donoghue Jan. 24, 2018, 2:50 p.m.
From: Rui Miguel Silva <rui.silva@linaro.org>

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.

[bod: changed name prefix to "crypto: caam: Fix .."]
[bod: added Fixes tag]

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

Tested-by: Ryan Harkin <ryan.harkin@linaro.org>

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>

Cc: "Horia Geantă" <horia.geanta@nxp.com>
Cc: Aymen Sghaier <aymen.sghaier@nxp.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Signed-off-by: Bryan O'Donoghue <pure.logic@nexus-software.ie>

 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 027e121..98986d3 100644
--- a/drivers/crypto/caam/ctrl.c
+++ b/drivers/crypto/caam/ctrl.c
@@ -809,9 +809,6 @@  static int caam_probe(struct platform_device *pdev)
 	return 0;
-	debugfs_remove_recursive(ctrlpriv->dfs_root);
 	return ret;