mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 16:12:59 +02:00
drm/gma500/oaktrail_lvds: fix i2c adapter leaks on init
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.
Make sure to drop the references taken by i2c_get_adapter() when falling
back to allocating an adapter as well as on late errors to allow the
looked up adapter to be deregistered.
Fixes: 1b082ccf59 ("gma500: Add Oaktrail support")
Cc: stable@vger.kernel.org # 3.3
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-4-johan@kernel.org
This commit is contained in:
parent
657a091ab6
commit
84d1c9b416
|
|
@ -367,6 +367,8 @@ void oaktrail_lvds_init(struct drm_device *dev,
|
|||
if (edid == NULL && dev_priv->lpc_gpio_base) {
|
||||
ddc_bus = oaktrail_lvds_i2c_init(dev);
|
||||
if (!IS_ERR(ddc_bus)) {
|
||||
if (i2c_adap)
|
||||
i2c_put_adapter(i2c_adap);
|
||||
i2c_adap = &ddc_bus->base;
|
||||
edid = drm_get_edid(connector, i2c_adap);
|
||||
}
|
||||
|
|
@ -423,6 +425,8 @@ void oaktrail_lvds_init(struct drm_device *dev,
|
|||
mutex_unlock(&dev->mode_config.mutex);
|
||||
if (!IS_ERR_OR_NULL(ddc_bus))
|
||||
gma_i2c_destroy(ddc_bus);
|
||||
else if (i2c_adap)
|
||||
i2c_put_adapter(i2c_adap);
|
||||
drm_encoder_cleanup(encoder);
|
||||
err_connector_cleanup:
|
||||
drm_connector_cleanup(connector);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user