mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
pmdomain: imx: fix OF node refcount
for_each_child_of_node_scoped() decrements the reference count of the
nod after each iteration. Assigning it without incrementing the refcount
to a dynamically allocated platform device will result in a double put
in platform_device_release(). Add the missing call to of_node_get().
Cc: stable@vger.kernel.org
Fixes: 3e4d109ee8 ("pmdomain: imx: gpc: Simplify with scoped for each OF child loop")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
This commit is contained in:
parent
4db207599a
commit
fba0510cd6
|
|
@ -487,7 +487,7 @@ static int imx_gpc_probe(struct platform_device *pdev)
|
|||
domain->ipg_rate_mhz = ipg_rate_mhz;
|
||||
|
||||
pd_pdev->dev.parent = &pdev->dev;
|
||||
pd_pdev->dev.of_node = np;
|
||||
pd_pdev->dev.of_node = of_node_get(np);
|
||||
pd_pdev->dev.fwnode = of_fwnode_handle(np);
|
||||
|
||||
ret = platform_device_add(pd_pdev);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user