mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
slimbus: qcom-ngd-ctrl: fix OF node refcount
Platform devices created with platform_device_alloc() call
platform_device_release() when the last reference to the device's
kobject is dropped. This function calls of_node_put() unconditionally.
This works fine for devices created with platform_device_register_full()
but users of the split approach (platform_device_alloc() +
platform_device_add()) must bump the reference of the of_node they
assign manually. Add the missing call to of_node_get().
Cc: stable@vger.kernel.org
Fixes: 917809e228 ("slimbus: ngd: Add qcom SLIMBus NGD driver")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
Link: https://patch.msgid.link/20260530204421.116824-2-srini@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
5b6b6fc491
commit
120134fe75
|
|
@ -1542,7 +1542,7 @@ static int of_qcom_slim_ngd_register(struct device *parent,
|
|||
kfree(ngd);
|
||||
return ret;
|
||||
}
|
||||
ngd->pdev->dev.of_node = node;
|
||||
ngd->pdev->dev.of_node = of_node_get(node);
|
||||
ctrl->ngd = ngd;
|
||||
|
||||
ret = platform_device_add(ngd->pdev);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user