diff options
| author | 2019-08-08 13:21:04 +0530 | |
|---|---|---|
| committer | 2019-08-28 12:40:31 +0300 | |
| commit | 6597f0b0516ab078b9ed2df4dd9aea17275995cd (patch) | |
| tree | 440bba5caf913f9943451dcd5078e12812544ccc /include/linux/mfd/git:/ssh:/git@git.zx2c4.com | |
| parent | mtd: spi-nor: Introduce spi_nor_get_flash_info() (diff) | |
| download | linux-dev-6597f0b0516ab078b9ed2df4dd9aea17275995cd.tar.xz linux-dev-6597f0b0516ab078b9ed2df4dd9aea17275995cd.zip | |
mtd: spi-nor: aspeed-smc: Add of_node_put()
Each iteration of for_each_available_child_of_node puts the previous
node, but in the case of a break from the middle of the loop, there is
no put, thus causing a memory leak. Upon termination of the loop
(whether by break or a natural exit), either ret will have a non-zero
value or child will be NULL. Hence add an of_node_put() that will
execute only when ret has a non-zero value, as calling of_node_put() on
a possible NULL value does not cause any further issues.
Issue found with Coccinelle.
Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Reviewed-by: Andrew Jeffery <andrew@aj.id.au>
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Diffstat (limited to 'include/linux/mfd/git:/ssh:/git@git.zx2c4.com')
0 files changed, 0 insertions, 0 deletions
