linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fbdev: da8xx-fb: go to proper label on error handling paths in probe
@ 2020-07-02 16:05 ` Evgeny Novikov
  2020-07-10 14:24   ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 2+ messages in thread
From: Evgeny Novikov @ 2020-07-02 16:05 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz
  Cc: Evgeny Novikov, Sekhar Nori, Bartosz Golaszewski, Daniel Vetter,
	Jani Nikula, dri-devel, linux-fbdev, linux-kernel, ldv-project

fb_probe() can successfully allocate a new frame buffer, but then fail
to perform some operations with regulator. In these cases fb_probe()
goes to label err_pm_runtime_disable where the frame buffer is not
released. The patch makes fb_probe() to go to label err_release_fb on
corresponding error handling paths.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Evgeny Novikov <novikov@ispras.ru>
---
 drivers/video/fbdev/da8xx-fb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/da8xx-fb.c b/drivers/video/fbdev/da8xx-fb.c
index 73c3c4c8cc12..e38c0e3f9c61 100644
--- a/drivers/video/fbdev/da8xx-fb.c
+++ b/drivers/video/fbdev/da8xx-fb.c
@@ -1402,14 +1402,14 @@ static int fb_probe(struct platform_device *device)
 	if (IS_ERR(par->lcd_supply)) {
 		if (PTR_ERR(par->lcd_supply) == -EPROBE_DEFER) {
 			ret = -EPROBE_DEFER;
-			goto err_pm_runtime_disable;
+			goto err_release_fb;
 		}
 
 		par->lcd_supply = NULL;
 	} else {
 		ret = regulator_enable(par->lcd_supply);
 		if (ret)
-			goto err_pm_runtime_disable;
+			goto err_release_fb;
 	}
 
 	fb_videomode_to_var(&da8xx_fb_var, lcdc_info);
-- 
2.16.4


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

* Re: [PATCH] fbdev: da8xx-fb: go to proper label on error handling paths in probe
  2020-07-02 16:05 ` [PATCH] fbdev: da8xx-fb: go to proper label on error handling paths in probe Evgeny Novikov
@ 2020-07-10 14:24   ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 2+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-07-10 14:24 UTC (permalink / raw)
  To: Evgeny Novikov
  Cc: Sekhar Nori, Bartosz Golaszewski, Daniel Vetter, Jani Nikula,
	dri-devel, linux-fbdev, linux-kernel, ldv-project


On 7/2/20 6:05 PM, Evgeny Novikov wrote:
> fb_probe() can successfully allocate a new frame buffer, but then fail
> to perform some operations with regulator. In these cases fb_probe()
> goes to label err_pm_runtime_disable where the frame buffer is not
> released. The patch makes fb_probe() to go to label err_release_fb on
> corresponding error handling paths.
> 
> Found by Linux Driver Verification project (linuxtesting.org).
> 
> Signed-off-by: Evgeny Novikov <novikov@ispras.ru>

Applied to drm-misc-next tree, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

> ---
>  drivers/video/fbdev/da8xx-fb.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/video/fbdev/da8xx-fb.c b/drivers/video/fbdev/da8xx-fb.c
> index 73c3c4c8cc12..e38c0e3f9c61 100644
> --- a/drivers/video/fbdev/da8xx-fb.c
> +++ b/drivers/video/fbdev/da8xx-fb.c
> @@ -1402,14 +1402,14 @@ static int fb_probe(struct platform_device *device)
>  	if (IS_ERR(par->lcd_supply)) {
>  		if (PTR_ERR(par->lcd_supply) == -EPROBE_DEFER) {
>  			ret = -EPROBE_DEFER;
> -			goto err_pm_runtime_disable;
> +			goto err_release_fb;
>  		}
>  
>  		par->lcd_supply = NULL;
>  	} else {
>  		ret = regulator_enable(par->lcd_supply);
>  		if (ret)
> -			goto err_pm_runtime_disable;
> +			goto err_release_fb;
>  	}
>  
>  	fb_videomode_to_var(&da8xx_fb_var, lcdc_info);
> 

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

end of thread, other threads:[~2020-07-10 14:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20200702160546eucas1p1b722eb071cdab13a7bfd47bd98a7d670@eucas1p1.samsung.com>
2020-07-02 16:05 ` [PATCH] fbdev: da8xx-fb: go to proper label on error handling paths in probe Evgeny Novikov
2020-07-10 14:24   ` Bartlomiej Zolnierkiewicz

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