diff mbox

[05/16] drm/mgag200: Copy fb name string before using it in mgag200_fb_create()

Message ID 1374066449-21714-6-git-send-email-eich@suse.com (mailing list archive)
State New, archived
Headers show

Commit Message

Egbert Eich July 17, 2013, 1:07 p.m. UTC
The fb id string was used in an error message right before it was set.
Reversing the order of the code fixes this.

Signed-off-by: Egbert Eich <eich@suse.de>
---
 drivers/gpu/drm/mgag200/mgag200_fb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/mgag200/mgag200_fb.c b/drivers/gpu/drm/mgag200/mgag200_fb.c
index 6453e4c..371f3eb 100644
--- a/drivers/gpu/drm/mgag200/mgag200_fb.c
+++ b/drivers/gpu/drm/mgag200/mgag200_fb.c
@@ -211,6 +211,8 @@  static int mgag200fb_create(struct drm_fb_helper *helper,
 	mfbdev->helper.fb = fb;
 	mfbdev->helper.fbdev = info;
 
+	strcpy(info->fix.id, "mgadrmfb");
+
 	ret = fb_alloc_cmap(&info->cmap, 256, 0);
 	if (ret) {
 		DRM_ERROR("%s: can't allocate color map\n", info->fix.id);
@@ -218,8 +220,6 @@  static int mgag200fb_create(struct drm_fb_helper *helper,
 		goto out;
 	}
 
-	strcpy(info->fix.id, "mgadrmfb");
-
 	info->flags = FBINFO_DEFAULT | FBINFO_CAN_FORCE_OUTPUT;
 	info->fbops = &mgag200fb_ops;