From patchwork Wed Jul 17 13:07:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Egbert Eich X-Patchwork-Id: 2828589 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9F6099F967 for ; Wed, 17 Jul 2013 13:11:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 81A9E2014C for ; Wed, 17 Jul 2013 13:11:22 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D70BF2011E for ; Wed, 17 Jul 2013 13:11:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CD621E6EF9 for ; Wed, 17 Jul 2013 06:11:17 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by gabe.freedesktop.org (Postfix) with ESMTP id 03F9EE5EC9 for ; Wed, 17 Jul 2013 06:07:51 -0700 (PDT) Received: from debian (p5DCF2FCF.dip0.t-ipconnect.de [93.207.47.207]) by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis) id 0M9eBT-1UrVEH12kB-00Cm0x; Wed, 17 Jul 2013 15:07:50 +0200 Received: from sles11.fritz.box (sles11.fritz.box [192.168.178.22]) by debian (Postfix) with ESMTP id D8C5513C77; Wed, 17 Jul 2013 15:07:46 +0200 (CEST) From: Egbert Eich To: dri-devel@lists.freedesktop.org Subject: [PATCH 05/16] drm/mgag200: Copy fb name string before using it in mgag200_fb_create() Date: Wed, 17 Jul 2013 15:07:18 +0200 Message-Id: <1374066449-21714-6-git-send-email-eich@suse.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1374066449-21714-1-git-send-email-eich@suse.com> References: <1374066449-21714-1-git-send-email-eich@suse.com> X-Provags-ID: V02:K0:8YB7uZXLn2mlAsdIYsnSrbrsBAgOPJoiYwuejTrJ+i9 5yqXTFFlU4qnsigWmLC65jSzEAGOT05i46mLcugxQLQyZ4dMpF t8cyPPchNBKLRdnrLkJYavqiuh5oCmsbXr/GH+6/3E6SMbg2yd D/0opUgi1anKL0jR5p7PEWpeTA8ZS0iewqS59rZrCqqA4SZD/x 7b3WI66zU4I/nVdrRJhKuDl59AQ+cZluX0OEu8mTmblji7TrUV xOT024pIGGuG2BC8JESc40PCHL9SrhwhkEozMeGrUtEJM3MmXV Eqidifl5OVEMygsfQEcQW2HPJ07CUP+UkEHdqK6ksyK5CgCpUW fvgK6n041l5QtWmxx+UgWC55qB7xsvd+dlVitZshp Cc: Egbert Eich , Egbert Eich , Mathieu Larouche , Dave Airlie , Christopher Harvey X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/gpu/drm/mgag200/mgag200_fb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;