drm/bridge: anx6345: Power off the bridge on removal
Subsystems (3)
PATCH 1/1 drm/bridge: anx6345: Power off the bridge on removal
The probe callback powers on the bridge to read its chip ID and leaves it powered on when the ID check succeeds. This enables both regulators and prepares the optional panel. If the device is removed before the bridge disable callback runs, these resources remain active after removal.
Power off the bridge in the remove callback before unregistering its I2C dummy clients. Check the powered flag first to avoid disabling regulators again when the bridge disable callback has already powered it off.
This issue was identified during our ongoing static-analysis research while reviewing kernel code.
---
Validated with an ARM64 W=1 object build and strict checkpatch. No hardware runtime or active-display unbind testing was performed.
drivers/gpu/drm/bridge/analogix/analogix-anx6345.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/bridge/analogix/analogix-anx6345.c +3 -0
@@ -775,6 +775,9 @@ static void anx6345_i2c_remove(struct i2c_client *client)drm_bridge_remove (&anx6345->bridge); +if (anx6345->powered) +anx6345_poweroff (anx6345); +unregister_i2c_dummy_clients (anx6345);drm_edid_free (anx6345->drm_edid);