android_kernel_samsung_sm8650/drivers/of
Dan Carpenter 315ae63050 of: dynamic: Fix potential memory leak in of_changeset_action()
commit 55e95bfccf6db8d26a66c46e1de50d53c59a6774 upstream.

Smatch complains that the error path where "action" is invalid leaks
the "ce" allocation:
    drivers/of/dynamic.c:935 of_changeset_action()
    warn: possible memory leak of 'ce'

Fix this by doing the validation before the allocation.

Note that there is not any actual problem with upstream kernels. All
callers of of_changeset_action() are static inlines with fixed action
values.

Fixes: 914d9d831e61 ("of: dynamic: Refactor action prints to not use "%pOF" inside devtree_lock")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/r/202309011059.EOdr4im9-lkp@intel.com/
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/7dfaf999-30ad-491c-9615-fb1138db121c@moroto.mountain
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-10-10 22:00:44 +02:00
..
unittest-data of: overlay: unittest: add tests for overlay notifiers 2022-05-03 11:53:15 -05:00
address.c of/address: Return an error when no valid dma-ranges are found 2023-02-14 19:11:42 +01:00
base.c Devicetree updates for v6.1: 2022-10-10 13:13:51 -07:00
device.c of: Fix modalias string generation 2023-05-11 23:03:28 +09:00
dynamic.c of: dynamic: Fix potential memory leak in of_changeset_action() 2023-10-10 22:00:44 +02:00
fdt_address.c of: Use SPDX license tag for DT files 2018-01-08 08:22:45 -06:00
fdt.c Revert "mm: kmemleak: alloc gray object for reserved region with direct map" 2023-02-09 11:28:20 +01:00
irq.c of: irq: Report individual failures in of_irq_init() 2022-09-07 10:54:55 -05:00
Kconfig of: net: move of_net under net/ 2021-10-07 13:39:51 +01:00
kexec.c mm,ima,kexec,of: use memblock_free_late from ima_free_kexec_buffer 2023-08-30 16:11:06 +02:00
kobj.c of: kobj: make of_node_is_(initialized|attached) parameters const 2021-10-20 13:37:25 -05:00
Makefile of: net: move of_net under net/ 2021-10-07 13:39:51 +01:00
of_numa.c of, numa: Fetch empty NUMA node ID from distance map 2021-10-04 13:13:44 -05:00
of_private.h of: Fix "dma-ranges" handling for bus controllers 2022-09-30 14:35:43 -05:00
of_reserved_mem.c of: reserved_mem: Have kmemleak ignore dynamically allocated reserved mem 2023-02-22 12:59:46 +01:00
overlay.c of: overlay: Call of_changeset_init() early 2023-09-13 09:42:44 +02:00
pdt.c of: Remove struct device_node.type pointer 2019-01-10 16:24:44 -06:00
platform.c treewide: Fix probing of devices in DT overlays 2023-09-13 09:43:05 +02:00
property.c of: property: fw_devlink: Add a devlink for panel followers 2023-09-13 09:43:04 +02:00
resolver.c of: overlay: log the error cause on resolver failure 2020-03-02 11:32:44 -06:00
unittest.c of: unittest: Fix overlay type in apply/revert check 2023-09-13 09:42:44 +02:00