mirror of
https://github.com/torvalds/linux.git
synced 2026-03-14 02:06:15 +01:00
drm/bridge: select_bus_fmt_recursive(): put the bridge obtained by drm_bridge_get_prev_bridge()
The bridge returned by drm_bridge_get_prev_bridge() is refcounted. Put it when done. select_bus_fmt_recursive() has several return points, and ensuring drm_bridge_put() is always called in the right place would be error-prone (especially with future changes to the select_bus_fmt_recursive() code) and make code uglier. Instead use a scope-based free, which is future-proof and a lot cleaner. Reviewed-by: Maxime Ripard <mripard@kernel.org> Link: https://lore.kernel.org/r/20250709-drm-bridge-alloc-getput-drm_bridge_get_prev_bridge-v1-2-34ba6f395aaa@bootlin.com Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
This commit is contained in:
parent
9b75346e3c
commit
d4eecb4c24
1 changed files with 2 additions and 2 deletions
|
|
@ -941,11 +941,11 @@ static int select_bus_fmt_recursive(struct drm_bridge *first_bridge,
|
|||
{
|
||||
unsigned int i, num_in_bus_fmts = 0;
|
||||
struct drm_bridge_state *cur_state;
|
||||
struct drm_bridge *prev_bridge;
|
||||
struct drm_bridge *prev_bridge __free(drm_bridge_put) =
|
||||
drm_bridge_get_prev_bridge(cur_bridge);
|
||||
u32 *in_bus_fmts;
|
||||
int ret;
|
||||
|
||||
prev_bridge = drm_bridge_get_prev_bridge(cur_bridge);
|
||||
cur_state = drm_atomic_get_new_bridge_state(crtc_state->state,
|
||||
cur_bridge);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue