drm/tilcdc: fix wrong error handling
Subsystems (3)
PATCH 1/1 drm/tilcdc: fix wrong error handling
When 'component_bind_all' fails it should not try to unbind components in the error handling. This will produce a null pointer kernel panic when no component exist.
This patch changes the order of the error handling. Now, it will only unbind components if the are bound. Otherwise, the module will jump to an error label below.
--- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/tilcdc/tilcdc_drv.c +3 -3
@@ -315,13 +315,13 @@ fail_irq_uninstall: fail_vblank_cleanup:drm_vblank_cleanup (dev); -fail_mode_config_cleanup: -drm_mode_config_cleanup (dev); - fail_component_cleanup:if (priv->is_componentized)component_unbind_all (dev->dev, dev); +fail_mode_config_cleanup: +drm_mode_config_cleanup (dev); + fail_external_cleanup:tilcdc_remove_external_encoders (dev);
Signature · 1 line
1.9.1
Quoted 9 lines · Daniel Schultz
When '
component_bind_all' fails it should not try to unbind components in the error handling. This will produce a null pointer kernel panic when no component exist.This patch changes the order of the error handling. Now, it will only unbind components if the are bound. Otherwise, the module will jump to an error label below.
Signed-off-by Daniel Schultz <[email protected]>
Quoted 28 lines
--- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/gpu/drm/tilcdc/tilcdc_drv.c +3
-4@@ -315,13 +315,13 @@ fail_irq_uninstall: fail_vblank_cleanup:drm_vblank_cleanup (dev); -fail_mode_config_cleanup: -drm_mode_config_cleanup (dev); - fail_component_cleanup:if (priv->is_componentized)component_unbind_all (dev->dev, dev); +fail_mode_config_cleanup: +drm_mode_config_cleanup (dev); + fail_external_cleanup:tilcdc_remove_external_encoders (dev); --1.9.1
Quoted 5 lines · Sean Paul
Quoted 4 lines · Daniel Schultz
When '
component_bind_all' fails it should not try to unbind components in the error handling. This will produce a null pointer kernel panic when no component exist.
Quoted 8 lines
Quoted 5 lines
This patch changes the order of the error handling. Now, it will only unbind components if the are bound. Otherwise, the module will jump to an error label below.
Signed-off-by Daniel Schultz <[email protected]>Reviewed-by Sean Paul <[email protected]>
Thanks, for both. Should I pick this one :)?
BR,
Jyri
Quoted 28 lines
Quoted 28 lines
--- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/gpu/drm/tilcdc/tilcdc_drv.c +3
-4@@ -315,13 +315,13 @@ fail_irq_uninstall: fail_vblank_cleanup:drm_vblank_cleanup (dev); -fail_mode_config_cleanup: -drm_mode_config_cleanup (dev); - fail_component_cleanup:if (priv->is_componentized)component_unbind_all (dev->dev, dev); +fail_mode_config_cleanup: +drm_mode_config_cleanup (dev); + fail_external_cleanup:tilcdc_remove_external_encoders (dev); --1.9.1
Quoted 10 lines · Jyri Sarha
Quoted 9 lines · Sean Paul
Quoted 8 lines · Daniel Schultz
When '
component_bind_all' fails it should not try to unbind components in the error handling. This will produce a null pointer kernel panic when no component exist.This patch changes the order of the error handling. Now, it will only unbind components if the are bound. Otherwise, the module will jump to an error label below.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Daniel Schultz <[email protected]>Reviewed-by Sean Paul <[email protected]>Thanks, for both. Should I pick this one :)?
Yes, it's all yours! :)
Sean
Quoted 32 lines
BR,
JyriQuoted 28 lines
Quoted 28 lines
--- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/gpu/drm/tilcdc/tilcdc_drv.c +3
-4@@ -315,13 +315,13 @@ fail_irq_uninstall: fail_vblank_cleanup:drm_vblank_cleanup (dev); -fail_mode_config_cleanup: -drm_mode_config_cleanup (dev); - fail_component_cleanup:if (priv->is_componentized)component_unbind_all (dev->dev, dev); +fail_mode_config_cleanup: +drm_mode_config_cleanup (dev); + fail_external_cleanup:tilcdc_remove_external_encoders (dev); --1.9.1