Skip to content

Commit

Permalink
drm/mgag200: Don't do full cleanup if mgag200_device_init fails
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christopher Harvey authored and Dave Airlie committed Jun 17, 2013
1 parent a080db9 commit 2791197
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/mgag200/mgag200_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2791197

Please sign in to comment.