aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2020-06-15 09:58:10 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-06-25 15:33:06 +0200
commite5b20d0b14517d43cc1606590ce4d8ff15e148f6 (patch)
tree32a32391cd82b0f10945ac96a00da3b31e35df83
parentedcb7efdbb96b80bb7ea86073f942e3c8f6a1605 (diff)
downloadlinux-yocto-e5b20d0b14517d43cc1606590ce4d8ff15e148f6.tar.gz
linux-yocto-e5b20d0b14517d43cc1606590ce4d8ff15e148f6.tar.bz2
linux-yocto-e5b20d0b14517d43cc1606590ce4d8ff15e148f6.zip
drm: encoder_slave: fix refcouting error for modules
[ Upstream commit f78d4032de60f50fd4afaa0fb68ea03b985f820a ] module_put() balances try_module_get(), not request_module(). Fix the error path to match that. Fixes: 2066facca4c7 ("drm/kms: slave encoder interface.") Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Wolfram Sang <wsa@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/gpu/drm/drm_encoder_slave.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_encoder_slave.c b/drivers/gpu/drm/drm_encoder_slave.c
index cf804389f5ec..d50a7884e69e 100644
--- a/drivers/gpu/drm/drm_encoder_slave.c
+++ b/drivers/gpu/drm/drm_encoder_slave.c
@@ -84,7 +84,7 @@ int drm_i2c_encoder_init(struct drm_device *dev,
err = encoder_drv->encoder_init(client, dev, encoder);
if (err)
- goto fail_unregister;
+ goto fail_module_put;
if (info->platform_data)
encoder->slave_funcs->set_config(&encoder->base,
@@ -92,9 +92,10 @@ int drm_i2c_encoder_init(struct drm_device *dev,
return 0;
+fail_module_put:
+ module_put(module);
fail_unregister:
i2c_unregister_device(client);
- module_put(module);
fail:
return err;
}