Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/bridge: fix OF node leak

Make sure to drop the OF node reference taken when creating the aux
bridge device when the device is later released.

Fixes: 6914968a0b52 ("drm/bridge: properly refcount DT nodes in aux bridge drivers")
Cc: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250708085124.15445-2-johan@kernel.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

authored by

Johan Hovold and committed by
Dmitry Baryshkov
be71ce97 b213eb34

+2
+2
drivers/gpu/drm/bridge/aux-bridge.c
··· 18 18 { 19 19 struct auxiliary_device *adev = to_auxiliary_dev(dev); 20 20 21 + of_node_put(dev->of_node); 21 22 ida_free(&drm_aux_bridge_ida, adev->id); 22 23 23 24 kfree(adev); ··· 66 65 67 66 ret = auxiliary_device_init(adev); 68 67 if (ret) { 68 + of_node_put(adev->dev.of_node); 69 69 ida_free(&drm_aux_bridge_ida, adev->id); 70 70 kfree(adev); 71 71 return ret;