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


Groups > linux.kernel > #1730669 > unrolled thread

[PATCH] video: fbdev: Fix an errro handling path in 'au1200fb_drv_probe()'

Started byChristophe JAILLET <christophe.jaillet@wanadoo.fr>
First post2017-09-12 07:50 +0200
Last post2017-09-12 07:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] video: fbdev: Fix an errro handling path in 'au1200fb_drv_probe()' Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2017-09-12 07:50 +0200

#1730669 — [PATCH] video: fbdev: Fix an errro handling path in 'au1200fb_drv_probe()'

FromChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Date2017-09-12 07:50 +0200
Subject[PATCH] video: fbdev: Fix an errro handling path in 'au1200fb_drv_probe()'
Message-ID<uoMf7-5BM-1@gated-at.bofh.it>
If 'dmam_alloc_attrs()' fails, we must go through the error handling code,
as done elsewhere in this function. Otherwise, there is a resource leak.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
I'm also puzzled by the 'framebuffer_alloc()' call a few lines above.
'ret' is known to be 0 at this point. I guess that -ENOMEM should also be
returned.
---
 drivers/video/fbdev/au1200fb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/au1200fb.c b/drivers/video/fbdev/au1200fb.c
index 5f04b4096c42..99d6cfb168b5 100644
--- a/drivers/video/fbdev/au1200fb.c
+++ b/drivers/video/fbdev/au1200fb.c
@@ -1701,7 +1701,8 @@ static int au1200fb_drv_probe(struct platform_device *dev)
 		if (!fbdev->fb_mem) {
 			print_err("fail to allocate frambuffer (size: %dK))",
 				  fbdev->fb_len / 1024);
-			return -ENOMEM;
+			ret = -ENOMEM;
+			goto failed;
 		}
 
 		/*
-- 
2.11.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web