Skip to content

Commit 9ee485b

Browse files
jhovoldsuperna9999
authored andcommitted
drm/bridge: aux-hpd: fix OF node leaks
The two device node references taken during allocation need to be dropped when the auxiliary device is freed. Fixes: 6914968 ("drm/bridge: properly refcount DT nodes in aux bridge drivers") Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Cc: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20240217150228.5788-2-johan+linaro@kernel.org Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20240217150228.5788-2-johan+linaro@kernel.org
1 parent 1fa8d07 commit 9ee485b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/gpu/drm/bridge/aux-hpd-bridge.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ static void drm_aux_hpd_bridge_release(struct device *dev)
2525
ida_free(&drm_aux_hpd_bridge_ida, adev->id);
2626

2727
of_node_put(adev->dev.platform_data);
28+
of_node_put(adev->dev.of_node);
2829

2930
kfree(adev);
3031
}
@@ -74,6 +75,8 @@ struct device *drm_dp_hpd_bridge_register(struct device *parent,
7475

7576
ret = auxiliary_device_init(adev);
7677
if (ret) {
78+
of_node_put(adev->dev.platform_data);
79+
of_node_put(adev->dev.of_node);
7780
ida_free(&drm_aux_hpd_bridge_ida, adev->id);
7881
kfree(adev);
7982
return ERR_PTR(ret);

0 commit comments

Comments
 (0)