Skip to content

Commit ce62600

Browse files
Adam Miotkmripard
authored andcommitted
drm/bridge/panel: Fix runtime warning on panel bridge release
Device managed panel bridge wrappers are created by calling to drm_panel_bridge_add_typed() and registering a release handler for clean-up when the device gets unbound. Since the memory for this bridge is also managed and linked to the panel device, the release function should not try to free that memory. Moreover, the call to devm_kfree() inside drm_panel_bridge_remove() will fail in this case and emit a warning because the panel bridge resource is no longer on the device resources list (it has been removed from there before the call to release handlers). Fixes: 6702222 ("drm/bridge: Add a devm_ allocator for panel bridge.") Signed-off-by: Adam Miotk <adam.miotk@arm.com> Signed-off-by: Maxime Ripard <mripard@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20240610102739.139852-1-adam.miotk@arm.com
1 parent b880018 commit ce62600

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/gpu/drm/bridge/panel.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,12 @@ EXPORT_SYMBOL(drm_panel_bridge_set_orientation);
360360

361361
static void devm_drm_panel_bridge_release(struct device *dev, void *res)
362362
{
363-
struct drm_bridge **bridge = res;
363+
struct drm_bridge *bridge = *(struct drm_bridge **)res;
364364

365-
drm_panel_bridge_remove(*bridge);
365+
if (!bridge)
366+
return;
367+
368+
drm_bridge_remove(bridge);
366369
}
367370

368371
/**

0 commit comments

Comments
 (0)