From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christopher Harvey Subject: Re: [PATCH] drm/mgag200: Don't do full cleanup if mgag200_device_init fails Date: Wed, 12 Jun 2013 13:16:40 -0400 Message-ID: <87mwqvtfk7.fsf@matrox.com> References: <20130605152957.6055AF4DC4@venus.matrox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mtxmxout5.matrox.com (mtxmxout5.matrox.com [138.11.2.95]) by gabe.freedesktop.org (Postfix) with ESMTP id 98E2FE5CB4 for ; Wed, 12 Jun 2013 10:12:56 -0700 (PDT) Received: from mars.matrox.com (mars.matrox.com [192.168.1.29]) by mtxmxout5.matrox.com (Postfix) with ESMTP id B08ED1C6DA6 for ; Wed, 12 Jun 2013 13:12:55 -0400 (EDT) Received: (from ssmsp@localhost) by mars.matrox.com (8.14.4/8.13.2) id r5CHCtNe027788 for dri-devel@lists.freedesktop.org; Wed, 12 Jun 2013 13:12:55 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by mars.matrox.com (Postfix) with ESMTP id 3224295220 for ; Wed, 12 Jun 2013 13:12:49 -0400 (EDT) Received: from matrox.com (dyn-152-224.matrox.com [192.168.152.224]) by mars.matrox.com (Postfix) with ESMTP id 3B754951FE for ; Wed, 12 Jun 2013 13:12:42 -0400 (EDT) In-reply-to: <20130605152957.6055AF4DC4@venus.matrox.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Wed, Jun 05 2013, Christopher Harvey wrote: > 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 > --- > 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) ping.