1 From 058592583359651b5fc125007dfa780c3fb6daf9 Mon Sep 17 00:00:00 2001
2 From: Julia Lawall <Julia.Lawall@lip6.fr>
3 Date: Sat, 23 Feb 2019 14:20:39 +0100
4 Subject: crypto: crypto4xx - add missing of_node_put after
7 [ Upstream commit 8c2b43d2d85b48a97d2f8279278a4aac5b45f925 ]
9 Add an of_node_put when a tested device node is not available.
11 The semantic patch that fixes this problem is as follows
12 (http://coccinelle.lip6.fr):
22 ... when != of_node_put(e)
26 if (<+...of_device_is_available(e)...+>) {
27 ... when != of_node_put(e)
37 Fixes: 5343e674f32fb ("crypto4xx: integrate ppc4xx-rng into crypto4xx")
38 Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
39 Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
40 Signed-off-by: Sasha Levin <sashal@kernel.org>
42 drivers/crypto/amcc/crypto4xx_trng.c | 4 +++-
43 1 file changed, 3 insertions(+), 1 deletion(-)
45 diff --git a/drivers/crypto/amcc/crypto4xx_trng.c b/drivers/crypto/amcc/crypto4xx_trng.c
46 index 5e63742b0d22..53ab1f140a26 100644
47 --- a/drivers/crypto/amcc/crypto4xx_trng.c
48 +++ b/drivers/crypto/amcc/crypto4xx_trng.c
49 @@ -80,8 +80,10 @@ void ppc4xx_trng_probe(struct crypto4xx_core_device *core_dev)
51 /* Find the TRNG device node and map it */
52 trng = of_find_matching_node(NULL, ppc4xx_trng_match);
53 - if (!trng || !of_device_is_available(trng))
54 + if (!trng || !of_device_is_available(trng)) {
59 dev->trng_base = of_iomap(trng, 0);