diff mbox series

drm: zynqmp_dpsub: Fix an error handling path in zynqmp_dpsub_probe()

Message ID 974d1b062d7c61ee6db00d16fa7c69aa1218ee02.1716198025.git.christophe.jaillet@wanadoo.fr (mailing list archive)
State New, archived
Headers show
Series drm: zynqmp_dpsub: Fix an error handling path in zynqmp_dpsub_probe() | expand

Commit Message

Christophe JAILLET May 20, 2024, 9:40 a.m. UTC
If zynqmp_dpsub_drm_init() fails, we must undo the previous
drm_bridge_add() call.

Fixes: be3f3042391d ("drm: zynqmp_dpsub: Always register bridge")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Compile tested only
---
 drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Sean Anderson May 20, 2024, 3:05 p.m. UTC | #1
On 5/20/24 05:40, Christophe JAILLET wrote:
> If zynqmp_dpsub_drm_init() fails, we must undo the previous
> drm_bridge_add() call.
> 
> Fixes: be3f3042391d ("drm: zynqmp_dpsub: Always register bridge")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> Compile tested only
> ---
>  drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c
> index face8d6b2a6f..f5781939de9c 100644
> --- a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c
> +++ b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c
> @@ -269,6 +269,7 @@ static int zynqmp_dpsub_probe(struct platform_device *pdev)
>  	return 0;
>  
>  err_disp:
> +	drm_bridge_remove(dpsub->bridge);
>  	zynqmp_disp_remove(dpsub);
>  err_dp:
>  	zynqmp_dp_remove(dpsub);

Reviewed-by: Sean Anderson <sean.anderso@linux.dev>
Laurent Pinchart May 22, 2024, 3:53 p.m. UTC | #2
Hi Christophe,

Thank you for the patch.

On Mon, May 20, 2024 at 11:40:37AM +0200, Christophe JAILLET wrote:
> If zynqmp_dpsub_drm_init() fails, we must undo the previous
> drm_bridge_add() call.
> 
> Fixes: be3f3042391d ("drm: zynqmp_dpsub: Always register bridge")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
> Compile tested only
> ---
>  drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c
> index face8d6b2a6f..f5781939de9c 100644
> --- a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c
> +++ b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c
> @@ -269,6 +269,7 @@ static int zynqmp_dpsub_probe(struct platform_device *pdev)
>  	return 0;
>  
>  err_disp:
> +	drm_bridge_remove(dpsub->bridge);
>  	zynqmp_disp_remove(dpsub);
>  err_dp:
>  	zynqmp_dp_remove(dpsub);
Sean Anderson June 13, 2024, 3:05 p.m. UTC | #3
On 5/20/24 11:05, Sean Anderson wrote:
> On 5/20/24 05:40, Christophe JAILLET wrote:
>> If zynqmp_dpsub_drm_init() fails, we must undo the previous
>> drm_bridge_add() call.
>> 
>> Fixes: be3f3042391d ("drm: zynqmp_dpsub: Always register bridge")
>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>> ---
>> Compile tested only
>> ---
>>  drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 1 +
>>  1 file changed, 1 insertion(+)
>> 
>> diff --git a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c
>> index face8d6b2a6f..f5781939de9c 100644
>> --- a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c
>> +++ b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c
>> @@ -269,6 +269,7 @@ static int zynqmp_dpsub_probe(struct platform_device *pdev)
>>  	return 0;
>>  
>>  err_disp:
>> +	drm_bridge_remove(dpsub->bridge);
>>  	zynqmp_disp_remove(dpsub);
>>  err_dp:
>>  	zynqmp_dp_remove(dpsub);
> 
> Reviewed-by: Sean Anderson <sean.anderso@linux.dev>

Will this be applied soon? The patch it fixes has made its way into the stable tree already.

--Sean
Laurent Pinchart June 16, 2024, 6:43 p.m. UTC | #4
On Thu, Jun 13, 2024 at 11:05:01AM -0400, Sean Anderson wrote:
> On 5/20/24 11:05, Sean Anderson wrote:
> > On 5/20/24 05:40, Christophe JAILLET wrote:
> >> If zynqmp_dpsub_drm_init() fails, we must undo the previous
> >> drm_bridge_add() call.
> >> 
> >> Fixes: be3f3042391d ("drm: zynqmp_dpsub: Always register bridge")
> >> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> >> ---
> >> Compile tested only
> >> ---
> >>  drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 1 +
> >>  1 file changed, 1 insertion(+)
> >> 
> >> diff --git a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c
> >> index face8d6b2a6f..f5781939de9c 100644
> >> --- a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c
> >> +++ b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c
> >> @@ -269,6 +269,7 @@ static int zynqmp_dpsub_probe(struct platform_device *pdev)
> >>  	return 0;
> >>  
> >>  err_disp:
> >> +	drm_bridge_remove(dpsub->bridge);
> >>  	zynqmp_disp_remove(dpsub);
> >>  err_dp:
> >>  	zynqmp_dp_remove(dpsub);
> > 
> > Reviewed-by: Sean Anderson <sean.anderso@linux.dev>
> 
> Will this be applied soon? The patch it fixes has made its way into
> the stable tree already.

If someone can merge it in drm-misc that would be the fastest way.
Otherwise I'll send a pull request at some point, but I'm overworked at
the moment.
Tomi Valkeinen June 17, 2024, 7:43 a.m. UTC | #5
Hi,

On 16/06/2024 21:43, Laurent Pinchart wrote:
> On Thu, Jun 13, 2024 at 11:05:01AM -0400, Sean Anderson wrote:
>> On 5/20/24 11:05, Sean Anderson wrote:
>>> On 5/20/24 05:40, Christophe JAILLET wrote:
>>>> If zynqmp_dpsub_drm_init() fails, we must undo the previous
>>>> drm_bridge_add() call.
>>>>
>>>> Fixes: be3f3042391d ("drm: zynqmp_dpsub: Always register bridge")
>>>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>>>> ---
>>>> Compile tested only
>>>> ---
>>>>   drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 1 +
>>>>   1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c
>>>> index face8d6b2a6f..f5781939de9c 100644
>>>> --- a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c
>>>> +++ b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c
>>>> @@ -269,6 +269,7 @@ static int zynqmp_dpsub_probe(struct platform_device *pdev)
>>>>   	return 0;
>>>>   
>>>>   err_disp:
>>>> +	drm_bridge_remove(dpsub->bridge);
>>>>   	zynqmp_disp_remove(dpsub);
>>>>   err_dp:
>>>>   	zynqmp_dp_remove(dpsub);
>>>
>>> Reviewed-by: Sean Anderson <sean.anderso@linux.dev>
>>
>> Will this be applied soon? The patch it fixes has made its way into
>> the stable tree already.
> 
> If someone can merge it in drm-misc that would be the fastest way.
> Otherwise I'll send a pull request at some point, but I'm overworked at
> the moment.
> 

Thanks, I have pushed this to drm-misc-next.

  Tomi
Laurent Pinchart June 17, 2024, 8:59 a.m. UTC | #6
On Mon, Jun 17, 2024 at 10:43:44AM +0300, Tomi Valkeinen wrote:
> On 16/06/2024 21:43, Laurent Pinchart wrote:
> > On Thu, Jun 13, 2024 at 11:05:01AM -0400, Sean Anderson wrote:
> >> On 5/20/24 11:05, Sean Anderson wrote:
> >>> On 5/20/24 05:40, Christophe JAILLET wrote:
> >>>> If zynqmp_dpsub_drm_init() fails, we must undo the previous
> >>>> drm_bridge_add() call.
> >>>>
> >>>> Fixes: be3f3042391d ("drm: zynqmp_dpsub: Always register bridge")
> >>>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> >>>> ---
> >>>> Compile tested only
> >>>> ---
> >>>>   drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 1 +
> >>>>   1 file changed, 1 insertion(+)
> >>>>
> >>>> diff --git a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c
> >>>> index face8d6b2a6f..f5781939de9c 100644
> >>>> --- a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c
> >>>> +++ b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c
> >>>> @@ -269,6 +269,7 @@ static int zynqmp_dpsub_probe(struct platform_device *pdev)
> >>>>   	return 0;
> >>>>   
> >>>>   err_disp:
> >>>> +	drm_bridge_remove(dpsub->bridge);
> >>>>   	zynqmp_disp_remove(dpsub);
> >>>>   err_dp:
> >>>>   	zynqmp_dp_remove(dpsub);
> >>>
> >>> Reviewed-by: Sean Anderson <sean.anderso@linux.dev>
> >>
> >> Will this be applied soon? The patch it fixes has made its way into
> >> the stable tree already.
> > 
> > If someone can merge it in drm-misc that would be the fastest way.
> > Otherwise I'll send a pull request at some point, but I'm overworked at
> > the moment.
> 
> Thanks, I have pushed this to drm-misc-next.

Thank you Tomi, much appreciated.
diff mbox series

Patch

diff --git a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c
index face8d6b2a6f..f5781939de9c 100644
--- a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c
+++ b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c
@@ -269,6 +269,7 @@  static int zynqmp_dpsub_probe(struct platform_device *pdev)
 	return 0;
 
 err_disp:
+	drm_bridge_remove(dpsub->bridge);
 	zynqmp_disp_remove(dpsub);
 err_dp:
 	zynqmp_dp_remove(dpsub);