All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/tilcdc: fix wrong error handling
@ 2016-09-23 10:52 Daniel Schultz
  2016-09-23 11:47 ` Sean Paul
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Schultz @ 2016-09-23 10:52 UTC (permalink / raw)
  To: jsarha, dri-devel; +Cc: tomi.valkeinen, airlied, linux-kernel

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/tilcdc: fix wrong error handling
  2016-09-23 10:52 [PATCH] drm/tilcdc: fix wrong error handling Daniel Schultz
@ 2016-09-23 11:47 ` Sean Paul
  2016-09-23 12:01   ` Jyri Sarha
  0 siblings, 1 reply; 4+ messages in thread
From: Sean Paul @ 2016-09-23 11:47 UTC (permalink / raw)
  To: Daniel Schultz
  Cc: Jyri Sarha, dri-devel, Tomi Valkeinen, Dave Airlie,
	Linux Kernel Mailing List

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
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/tilcdc: fix wrong error handling
  2016-09-23 11:47 ` Sean Paul
@ 2016-09-23 12:01   ` Jyri Sarha
  2016-09-23 12:01     ` Sean Paul
  0 siblings, 1 reply; 4+ messages in thread
From: Jyri Sarha @ 2016-09-23 12:01 UTC (permalink / raw)
  To: Sean Paul, Daniel Schultz
  Cc: dri-devel, Tomi Valkeinen, Dave Airlie, Linux Kernel Mailing List

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
>>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/tilcdc: fix wrong error handling
  2016-09-23 12:01   ` Jyri Sarha
@ 2016-09-23 12:01     ` Sean Paul
  0 siblings, 0 replies; 4+ messages in thread
From: Sean Paul @ 2016-09-23 12:01 UTC (permalink / raw)
  To: Jyri Sarha
  Cc: Daniel Schultz, dri-devel, Tomi Valkeinen, Dave Airlie,
	Linux Kernel Mailing List

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
>>>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-09-23 12:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-23 10:52 [PATCH] drm/tilcdc: fix wrong error handling Daniel Schultz
2016-09-23 11:47 ` Sean Paul
2016-09-23 12:01   ` Jyri Sarha
2016-09-23 12:01     ` Sean Paul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.