Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fbed2028 authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Miquel Raynal
Browse files

mtd: rawnand: atmel: Fix potential NULL pointer dereference



There is a potential execution path in which function
of_find_compatible_node() returns NULL. In such a case,
we end up having a NULL pointer dereference when accessing
pointer *nfc_np* in function of_clk_get().

So, we better don't take any chances and fix this by null
checking pointer *nfc_np* before calling of_clk_get().

Addresses-Coverity-ID: 1473052 ("Dereference null return value")
Fixes: f88fc122 ("mtd: nand: Cleanup/rework the atmel_nand driver")
Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
Acked-by: default avatarTudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
parent e8237bfa
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment