Commit a7ca52e1 authored by Zach Reizner's avatar Zach Reizner Committed by Dave Airlie

drm/cirrus: fix leaky driver load error handling

Before this patch, cirrus_device_init could have failed while
cirrus_mm_init succeeded and the driver would have reported overall
success on load. This patch causes cirrus_device_init to return on
the first error encountered.
Reviewed-by: default avatarStéphane Marchesin <marcheu@chromium.org>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent b0fcfc89
...@@ -179,16 +179,21 @@ int cirrus_driver_load(struct drm_device *dev, unsigned long flags) ...@@ -179,16 +179,21 @@ int cirrus_driver_load(struct drm_device *dev, unsigned long flags)
} }
r = cirrus_mm_init(cdev); r = cirrus_mm_init(cdev);
if (r) if (r) {
dev_err(&dev->pdev->dev, "fatal err on mm init\n"); dev_err(&dev->pdev->dev, "fatal err on mm init\n");
goto out;
}
r = cirrus_modeset_init(cdev); r = cirrus_modeset_init(cdev);
if (r) if (r) {
dev_err(&dev->pdev->dev, "Fatal error during modeset init: %d\n", r); dev_err(&dev->pdev->dev, "Fatal error during modeset init: %d\n", r);
goto out;
}
dev->mode_config.funcs = (void *)&cirrus_mode_funcs; dev->mode_config.funcs = (void *)&cirrus_mode_funcs;
return 0;
out: out:
if (r)
cirrus_driver_unload(dev); cirrus_driver_unload(dev);
return r; return 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