Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1489939 > unrolled thread

[PATCH] drm/tilcdc: fix wrong error handling

Started byDaniel Schultz <d.schultz@phytec.de>
First post2016-09-23 13:00 +0200
Last post2016-09-23 14:10 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] drm/tilcdc: fix wrong error handling Daniel Schultz <d.schultz@phytec.de> - 2016-09-23 13:00 +0200
    Re: [PATCH] drm/tilcdc: fix wrong error handling Sean Paul <seanpaul@google.com> - 2016-09-23 13:50 +0200
      Re: [PATCH] drm/tilcdc: fix wrong error handling Jyri Sarha <jsarha@ti.com> - 2016-09-23 14:10 +0200
        Re: [PATCH] drm/tilcdc: fix wrong error handling Sean Paul <seanpaul@google.com> - 2016-09-23 14:10 +0200

#1489939 — [PATCH] drm/tilcdc: fix wrong error handling

FromDaniel Schultz <d.schultz@phytec.de>
Date2016-09-23 13:00 +0200
Subject[PATCH] drm/tilcdc: fix wrong error handling
Message-ID<skwmZ-2zw-5@gated-at.bofh.it>
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 <d.schultz@phytec.de>
---
 drivers/gpu/drm/tilcdc/tilcdc_drv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index d278093..d491610 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -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

[toc] | [next] | [standalone]


#1489969

FromSean Paul <seanpaul@google.com>
Date2016-09-23 13:50 +0200
Message-ID<skx9o-35a-13@gated-at.bofh.it>
In reply to#1489939
On Fri, Sep 23, 2016 at 3:52 AM, Daniel Schultz <d.schultz@phytec.de> wrote:
> 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 <d.schultz@phytec.de>

Reviewed-by: Sean Paul <seanpaul@chromium.org>

> ---
>  drivers/gpu/drm/tilcdc/tilcdc_drv.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> index d278093..d491610 100644
> --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> @@ -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
>

[toc] | [prev] | [next] | [standalone]


#1489976

FromJyri Sarha <jsarha@ti.com>
Date2016-09-23 14:10 +0200
Message-ID<skxsJ-3rG-7@gated-at.bofh.it>
In reply to#1489969
On 09/23/16 14:47, Sean Paul wrote:
> On Fri, Sep 23, 2016 at 3:52 AM, Daniel Schultz <d.schultz@phytec.de> wrote:
>> 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 <d.schultz@phytec.de>
> 
> Reviewed-by: Sean Paul <seanpaul@chromium.org>
> 

Thanks, for both. Should I pick this one :)?

BR,
Jyri

>> ---
>>  drivers/gpu/drm/tilcdc/tilcdc_drv.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
>> index d278093..d491610 100644
>> --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
>> +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
>> @@ -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
>>

[toc] | [prev] | [next] | [standalone]


#1489983

FromSean Paul <seanpaul@google.com>
Date2016-09-23 14:10 +0200
Message-ID<skxsJ-3rG-21@gated-at.bofh.it>
In reply to#1489976
On Fri, Sep 23, 2016 at 5:01 AM, Jyri Sarha <jsarha@ti.com> wrote:
> On 09/23/16 14:47, Sean Paul wrote:
>> On Fri, Sep 23, 2016 at 3:52 AM, Daniel Schultz <d.schultz@phytec.de> wrote:
>>> 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 <d.schultz@phytec.de>
>>
>> Reviewed-by: Sean Paul <seanpaul@chromium.org>
>>
>
> Thanks, for both. Should I pick this one :)?
>

Yes, it's all yours! :)

Sean


> BR,
> Jyri
>
>>> ---
>>>  drivers/gpu/drm/tilcdc/tilcdc_drv.c | 6 +++---
>>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
>>> index d278093..d491610 100644
>>> --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
>>> +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
>>> @@ -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
>>>
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web