From patchwork Wed Jun 5 15:29:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Harvey X-Patchwork-Id: 2670731 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 8EC5EDF264 for ; Wed, 5 Jun 2013 15:30:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 82FFEE659C for ; Wed, 5 Jun 2013 08:30:19 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mtxmxout6.matrox.com (mtxmxout6.matrox.com [138.11.2.96]) by gabe.freedesktop.org (Postfix) with ESMTP id 21FE2E5CD3 for ; Wed, 5 Jun 2013 08:30:09 -0700 (PDT) Received: from venus.matrox.com (venus.matrox.com [192.168.1.30]) by mtxmxout6.matrox.com (Postfix) with ESMTP id 2F4A957AAE for ; Wed, 5 Jun 2013 11:30:08 -0400 (EDT) Received: (from ssmsp@localhost) by venus.matrox.com (8.14.4/8.13.2) id r55FU7JB030489; Wed, 5 Jun 2013 11:30:07 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by venus.matrox.com (Postfix) with ESMTP id 20120F4DCC; Wed, 5 Jun 2013 11:30:03 -0400 (EDT) X-Virus-MTX-Scanned: by Matrox Virus scanner at venus.matrox.com Received: from matrox.com (dyn-152-224.matrox.com [192.168.152.224]) by venus.matrox.com (Postfix) with ESMTP id 6055AF4DC4; Wed, 5 Jun 2013 11:29:57 -0400 (EDT) From: Christopher Harvey Subject: [PATCH] drm/mgag200: Don't do full cleanup if mgag200_device_init fails To: dri-devel@lists.freedesktop.org Message-Id: <20130605152957.6055AF4DC4@venus.matrox.com> Date: Wed, 5 Jun 2013 11:29:57 -0400 (EDT) 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 Running mgag200_driver_unload when the driver init fails early on causes functions like drm_mode_config_cleanup to be called. The problem is, drm_mode_config_cleanup crashes because the corresponding init hasn't happend yet. There really isn't anything to cleanup after mgag200_device_init, so we can just pass the error code upwards. Acked-by: Julia Lemire Signed-off-by: Christopher Harvey Acked-by: Paul Menzel --- drivers/gpu/drm/mgag200/mgag200_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mgag200/mgag200_main.c b/drivers/gpu/drm/mgag200/mgag200_main.c index 5189675..6d6b598 100644 --- a/drivers/gpu/drm/mgag200/mgag200_main.c +++ b/drivers/gpu/drm/mgag200/mgag200_main.c @@ -209,7 +209,7 @@ int mgag200_driver_load(struct drm_device *dev, unsigned long flags) r = mgag200_device_init(dev, flags); if (r) { dev_err(&dev->pdev->dev, "Fatal error during GPU init: %d\n", r); - goto out; + return r; } r = mgag200_mm_init(mdev); if (r)