]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
drm/mgag200: Don't do full cleanup if mgag200_device_init fails
authorChristopher Harvey <charvey@matrox.com>
Wed, 5 Jun 2013 15:29:57 +0000 (11:29 -0400)
committerDave Airlie <airlied@gmail.com>
Mon, 17 Jun 2013 09:42:49 +0000 (19:42 +1000)
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 <jlemire@matrox.com>
Signed-off-by: Christopher Harvey <charvey@matrox.com>
Acked-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Dave Airlie <airlied@gmail.com>
drivers/gpu/drm/mgag200/mgag200_main.c

index 51896757b3c2e9a7583c619e6e2f824b45b8857e..6d6b598ff7916a6ce90d2904c67ebb5da78240dc 100644 (file)
@@ -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)