linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/stm: Fix an error handling path in 'stm_drm_platform_probe()'
@ 2020-05-01 12:55 Christophe JAILLET
  0 siblings, 0 replies; 3+ messages in thread
From: Christophe JAILLET @ 2020-05-01 12:55 UTC (permalink / raw)
  To: yannick.fertre, philippe.cornu, benjamin.gaignard,
	vincent.abriou, airlied, daniel, mcoquelin.stm32,
	alexandre.torgue, eric, narmstrong
  Cc: dri-devel, linux-stm32, linux-arm-kernel, linux-kernel,
	kernel-janitors, Christophe JAILLET

If 'drm_dev_register()' fails, a call to 'drv_load()' must be undone, as
already done in the remove function.

Fixes: b759012c5fa7 ("drm/stm: Add STM32 LTDC driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/gpu/drm/stm/drv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c
index ea9fcbdc68b3..9a66e350abd5 100644
--- a/drivers/gpu/drm/stm/drv.c
+++ b/drivers/gpu/drm/stm/drv.c
@@ -206,12 +206,14 @@ static int stm_drm_platform_probe(struct platform_device *pdev)
 
 	ret = drm_dev_register(ddev, 0);
 	if (ret)
-		goto err_put;
+		goto err_unload;
 
 	drm_fbdev_generic_setup(ddev, 16);
 
 	return 0;
 
+err_unload:
+	drv_unload(ddev);
 err_put:
 	drm_dev_put(ddev);
 
-- 
2.25.1


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

* Re: [PATCH] drm/stm: Fix an error handling path in stm_drm_platform_probe()
  2024-01-06 16:54 [PATCH] drm/stm: Fix an error handling path in stm_drm_platform_probe() Christophe JAILLET
@ 2024-01-10  9:54 ` Raphael Gallais-Pou
  0 siblings, 0 replies; 3+ messages in thread
From: Raphael Gallais-Pou @ 2024-01-10  9:54 UTC (permalink / raw)
  To: Christophe JAILLET, Yannick Fertre, Philippe Cornu,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Maxime Coquelin, Alexandre Torgue,
	Eric Anholt, Neil Armstrong
  Cc: linux-kernel, kernel-janitors, Yannick Fertre, dri-devel,
	linux-stm32, linux-arm-kernel

Hi Christophe,

On 1/6/24 17:54, Christophe JAILLET wrote:
> If drm_dev_register() fails, a call to drv_load() must be undone, as
> already done in the remove function.
>
> Fixes: b759012c5fa7 ("drm/stm: Add STM32 LTDC driver")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> This was already sent a few years ago in [1] but it got no response.
> Since, there has been some activity on this driver, so I send it again.
>
> Note that it is untested.
>
> [1]: https://lore.kernel.org/all/20200501125511.132029-1-christophe.jaillet@wanadoo.fr/
> ---
>  drivers/gpu/drm/stm/drv.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
I tested it against stm32mp157c-dk2.dts.

Thanks for your submission.

Acked-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>


Regards,

Raphaël Gallais-Pou


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

* [PATCH] drm/stm: Fix an error handling path in stm_drm_platform_probe()
@ 2024-01-06 16:54 Christophe JAILLET
  2024-01-10  9:54 ` Raphael Gallais-Pou
  0 siblings, 1 reply; 3+ messages in thread
From: Christophe JAILLET @ 2024-01-06 16:54 UTC (permalink / raw)
  To: Yannick Fertre, Raphael Gallais-Pou, Philippe Cornu,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Daniel Vetter, Maxime Coquelin, Alexandre Torgue,
	Eric Anholt, Neil Armstrong
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET,
	Yannick Fertre, dri-devel, linux-stm32, linux-arm-kernel

If drm_dev_register() fails, a call to drv_load() must be undone, as
already done in the remove function.

Fixes: b759012c5fa7 ("drm/stm: Add STM32 LTDC driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
This was already sent a few years ago in [1] but it got no response.
Since, there has been some activity on this driver, so I send it again.

Note that it is untested.

[1]: https://lore.kernel.org/all/20200501125511.132029-1-christophe.jaillet@wanadoo.fr/
---
 drivers/gpu/drm/stm/drv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c
index e8523abef27a..4d2db079ad4f 100644
--- a/drivers/gpu/drm/stm/drv.c
+++ b/drivers/gpu/drm/stm/drv.c
@@ -203,12 +203,14 @@ static int stm_drm_platform_probe(struct platform_device *pdev)
 
 	ret = drm_dev_register(ddev, 0);
 	if (ret)
-		goto err_put;
+		goto err_unload;
 
 	drm_fbdev_dma_setup(ddev, 16);
 
 	return 0;
 
+err_unload:
+	drv_unload(ddev);
 err_put:
 	drm_dev_put(ddev);
 
-- 
2.34.1


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

end of thread, other threads:[~2024-01-10  9:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-01 12:55 [PATCH] drm/stm: Fix an error handling path in 'stm_drm_platform_probe()' Christophe JAILLET
2024-01-06 16:54 [PATCH] drm/stm: Fix an error handling path in stm_drm_platform_probe() Christophe JAILLET
2024-01-10  9:54 ` Raphael Gallais-Pou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).