Commit 27911977 authored by Christopher Harvey's avatar Christopher Harvey Committed by Dave Airlie

drm/mgag200: Don't do full cleanup if mgag200_device_init fails

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: default avatarJulia Lemire <jlemire@matrox.com>
Signed-off-by: default avatarChristopher Harvey <charvey@matrox.com>
Acked-by: default avatarPaul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: default avatarDave Airlie <airlied@gmail.com>
parent a080db9f
...@@ -209,7 +209,7 @@ int mgag200_driver_load(struct drm_device *dev, unsigned long flags) ...@@ -209,7 +209,7 @@ int mgag200_driver_load(struct drm_device *dev, unsigned long flags)
r = mgag200_device_init(dev, flags); r = mgag200_device_init(dev, flags);
if (r) { if (r) {
dev_err(&dev->pdev->dev, "Fatal error during GPU init: %d\n", r); dev_err(&dev->pdev->dev, "Fatal error during GPU init: %d\n", r);
goto out; return r;
} }
r = mgag200_mm_init(mdev); r = mgag200_mm_init(mdev);
if (r) if (r)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment