diff options
author | Dave Airlie <airlied@redhat.com> | 2010-01-31 20:22:10 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-01-31 20:22:10 -0500 |
commit | 4b866288be6ffaefaad9cec212cb09e3258a68ee (patch) | |
tree | 81317f5c119f6429324118bb5db9a658d429e224 /drivers | |
parent | 2dea2e29b9fad48c759aa406b5ea426bff4339af (diff) |
drm/radeon/kms: release agp on error.
if we get an error, release the AGP if we've acquired it already.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_agp.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_agp.c b/drivers/gpu/drm/radeon/radeon_agp.c index b634d9847667..c0681a5556dc 100644 --- a/drivers/gpu/drm/radeon/radeon_agp.c +++ b/drivers/gpu/drm/radeon/radeon_agp.c | |||
@@ -144,11 +144,13 @@ int radeon_agp_init(struct radeon_device *rdev) | |||
144 | 144 | ||
145 | ret = drm_agp_info(rdev->ddev, &info); | 145 | ret = drm_agp_info(rdev->ddev, &info); |
146 | if (ret) { | 146 | if (ret) { |
147 | drm_agp_release(rdev->ddev); | ||
147 | DRM_ERROR("Unable to get AGP info: %d\n", ret); | 148 | DRM_ERROR("Unable to get AGP info: %d\n", ret); |
148 | return ret; | 149 | return ret; |
149 | } | 150 | } |
150 | 151 | ||
151 | if (rdev->ddev->agp->agp_info.aper_size < 32) { | 152 | if (rdev->ddev->agp->agp_info.aper_size < 32) { |
153 | drm_agp_release(rdev->ddev); | ||
152 | dev_warn(rdev->dev, "AGP aperture too small (%zuM) " | 154 | dev_warn(rdev->dev, "AGP aperture too small (%zuM) " |
153 | "need at least 32M, disabling AGP\n", | 155 | "need at least 32M, disabling AGP\n", |
154 | rdev->ddev->agp->agp_info.aper_size); | 156 | rdev->ddev->agp->agp_info.aper_size); |
@@ -229,6 +231,7 @@ int radeon_agp_init(struct radeon_device *rdev) | |||
229 | ret = drm_agp_enable(rdev->ddev, mode); | 231 | ret = drm_agp_enable(rdev->ddev, mode); |
230 | if (ret) { | 232 | if (ret) { |
231 | DRM_ERROR("Unable to enable AGP (mode = 0x%lx)\n", mode.mode); | 233 | DRM_ERROR("Unable to enable AGP (mode = 0x%lx)\n", mode.mode); |
234 | drm_agp_release(rdev->ddev); | ||
232 | return ret; | 235 | return ret; |
233 | } | 236 | } |
234 | 237 | ||