Skip to content

Commit ab92569

Browse files
jhovoldgregkh
authored andcommitted
drm/gma500/oaktrail_lvds: fix hang on init failure
commit 657a091ab6d01d0091b77660c75cfed573c9a53e upstream. The LVDS init code looks up an I2C adapter using i2c_get_adapter() and tries to read the EDID before falling back to allocating and registering its own adapter. The error handling does not separate these cases so on a late init failure it will try to deregister and free also an adapter that had previously been registered. Since i2c_get_adapter() takes another reference to the adapter, deregistration hangs indefinitely while waiting for the reference to be released. Fix this by only destroying adapters allocated during LVDS init on errors. Fixes: a57ebfc ("drm/gma500: Make oaktrail lvds use ddc adapter from drm_connector") Cc: stable@vger.kernel.org # 6.0 Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Link: https://patch.msgid.link/20260508144446.59722-3-johan@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6d835a9 commit ab92569

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

drivers/gpu/drm/gma500/oaktrail_lvds.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ void oaktrail_lvds_init(struct drm_device *dev,
292292
{
293293
struct gma_encoder *gma_encoder;
294294
struct gma_connector *gma_connector;
295-
struct gma_i2c_chan *ddc_bus;
295+
struct gma_i2c_chan *ddc_bus = NULL;
296296
struct drm_connector *connector;
297297
struct drm_encoder *encoder;
298298
struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
@@ -420,7 +420,8 @@ void oaktrail_lvds_init(struct drm_device *dev,
420420

421421
err_unlock:
422422
mutex_unlock(&dev->mode_config.mutex);
423-
gma_i2c_destroy(to_gma_i2c_chan(connector->ddc));
423+
if (!IS_ERR_OR_NULL(ddc_bus))
424+
gma_i2c_destroy(ddc_bus);
424425
drm_encoder_cleanup(encoder);
425426
err_connector_cleanup:
426427
drm_connector_cleanup(connector);

0 commit comments

Comments
 (0)