Commit 4b866288 authored by Dave Airlie's avatar Dave Airlie

drm/radeon/kms: release agp on error.

if we get an error, release the AGP if we've acquired it already.
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 2dea2e29
...@@ -144,11 +144,13 @@ int radeon_agp_init(struct radeon_device *rdev) ...@@ -144,11 +144,13 @@ int radeon_agp_init(struct radeon_device *rdev)
ret = drm_agp_info(rdev->ddev, &info); ret = drm_agp_info(rdev->ddev, &info);
if (ret) { if (ret) {
drm_agp_release(rdev->ddev);
DRM_ERROR("Unable to get AGP info: %d\n", ret); DRM_ERROR("Unable to get AGP info: %d\n", ret);
return ret; return ret;
} }
if (rdev->ddev->agp->agp_info.aper_size < 32) { if (rdev->ddev->agp->agp_info.aper_size < 32) {
drm_agp_release(rdev->ddev);
dev_warn(rdev->dev, "AGP aperture too small (%zuM) " dev_warn(rdev->dev, "AGP aperture too small (%zuM) "
"need at least 32M, disabling AGP\n", "need at least 32M, disabling AGP\n",
rdev->ddev->agp->agp_info.aper_size); rdev->ddev->agp->agp_info.aper_size);
...@@ -229,6 +231,7 @@ int radeon_agp_init(struct radeon_device *rdev) ...@@ -229,6 +231,7 @@ int radeon_agp_init(struct radeon_device *rdev)
ret = drm_agp_enable(rdev->ddev, mode); ret = drm_agp_enable(rdev->ddev, mode);
if (ret) { if (ret) {
DRM_ERROR("Unable to enable AGP (mode = 0x%lx)\n", mode.mode); DRM_ERROR("Unable to enable AGP (mode = 0x%lx)\n", mode.mode);
drm_agp_release(rdev->ddev);
return ret; return ret;
} }
......
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