mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
crypto: crypto4xx - fix a potential double free in ppc4xx_trng_probe
There is a possible double free issue in ppc4xx_trng_probe():
85: dev->trng_base = of_iomap(trng, 0);
86: of_node_put(trng); ---> released here
87: if (!dev->trng_base)
88: goto err_out;
...
110: ierr_out:
111: of_node_put(trng); ---> double released here
...
This issue was detected by using the Coccinelle software.
We fix it by removing the unnecessary of_node_put().
Fixes: 5343e674f3 ("crypto4xx: integrate ppc4xx-rng into crypto4xx")
Signed-off-by: Wen Yang <[email protected]>
Cc: <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Allison Randal <[email protected]>
Cc: Armijn Hemel <[email protected]>
Cc: Julia Lawall <[email protected]>
Cc: [email protected]
Cc: [email protected]
Acked-by: Julia Lawall <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
This commit is contained in:
parent
049ce1505b
commit
95566aa75c
1 changed files with 0 additions and 1 deletions
|
|
@ -111,7 +111,6 @@ void ppc4xx_trng_probe(struct crypto4xx_core_device *core_dev)
|
|||
return;
|
||||
|
||||
err_out:
|
||||
of_node_put(trng);
|
||||
iounmap(dev->trng_base);
|
||||
kfree(rng);
|
||||
dev->trng_base = NULL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue