Skip to contentSkip to conversation

drm/mgag200: fix error return code in mgag200fb_create()

PATCH Applied Wei Yongjun 2 participants 2 messages Aug 15, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/mgag200: fix error return code in mgag200fb_create()

Fix to return error code -ENOMEM from the vmalloc() error handling case instead of 0, as done elsewhere in this function.

Fixes aec9e12953e7 ("drm/mgag200: Fix error handling paths in fbdev driver")
---
 drivers/gpu/drm/mgag200/mgag200_fb.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/mgag200/mgag200_fb.c +3 -1
index 81325f6..88dd221 100644
@@ -183,8 +183,10 @@ static int mgag200fb_create(struct drm_fb_helper *helper,
 	}
 
 	sysram = vmalloc(size);
-	if (!sysram)
+	if (!sysram) {
+		ret = -ENOMEM;
 		goto err_sysram;
+	}
 
 	info = drm_fb_helper_alloc_fbi(helper);
 	if (IS_ERR(info)) {
#1 lore raw
Quoted 5 lines · Wei Yongjun

Fix to return error code -ENOMEM from the vmalloc() error handling case instead of 0, as done elsewhere in this function.

Fixes aec9e12953e7 ("drm/mgag200: Fix error handling paths in fbdev driver")

Applied to drm-misc, thanks.
-Daniel

Quoted 21 lines
---
 drivers/gpu/drm/mgag200/mgag200_fb.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/mgag200/mgag200_fb.c +3 -1
index 81325f6..88dd221 100644
@@ -183,8 +183,10 @@ static int mgag200fb_create(struct drm_fb_helper *helper,
 	}
 
 	sysram = vmalloc(size);
-	if (!sysram)
+	if (!sysram) {
+		ret = -ENOMEM;
 		goto err_sysram;
+	}
 
 	info = drm_fb_helper_alloc_fbi(helper);
 	if (IS_ERR(info)) {
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel