Skip to content

Commit

Permalink
drm/bridge: aux-hpd: fix OF node leaks
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Johan Hovold authored and Neil Armstrong committed Feb 23, 2024
1 parent 1fa8d07 commit 9ee485b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/gpu/drm/bridge/aux-hpd-bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ static void drm_aux_hpd_bridge_release(struct device *dev)
ida_free(&drm_aux_hpd_bridge_ida, adev->id);

of_node_put(adev->dev.platform_data);
of_node_put(adev->dev.of_node);

kfree(adev);
}
Expand Down Expand Up @@ -74,6 +75,8 @@ struct device *drm_dp_hpd_bridge_register(struct device *parent,

ret = auxiliary_device_init(adev);
if (ret) {
of_node_put(adev->dev.platform_data);
of_node_put(adev->dev.of_node);
ida_free(&drm_aux_hpd_bridge_ida, adev->id);
kfree(adev);
return ERR_PTR(ret);
Expand Down

0 comments on commit 9ee485b

Please sign in to comment.