Commit ccb2ad57 authored by Robert Fitzsimons's avatar Robert Fitzsimons Committed by Dave Airlie

drm/radeon/kms/agp The wrong AGP chipset can cause a NULL pointer dereference

Selecting the wrong or no CONFIG_AGP_* chipset can cause a NULL pointer
dereference when combined with CONFIG_DRM_RADEON_KMS and an old system
with a R100 AGP card (should effect other cards too).  The agp field
will be set to NULL if no suitable AGP chipset driver is loaded,
drm_agp_acquire already preforms a suitable NULL check so it can be used
directly.
Signed-off-by: default avatarRobert Fitzsimons <robfitz@273k.net>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 797fd5b9
...@@ -134,12 +134,10 @@ int radeon_agp_init(struct radeon_device *rdev) ...@@ -134,12 +134,10 @@ int radeon_agp_init(struct radeon_device *rdev)
int ret; int ret;
/* Acquire AGP. */ /* Acquire AGP. */
if (!rdev->ddev->agp->acquired) { ret = drm_agp_acquire(rdev->ddev);
ret = drm_agp_acquire(rdev->ddev); if (ret) {
if (ret) { DRM_ERROR("Unable to acquire AGP: %d\n", ret);
DRM_ERROR("Unable to acquire AGP: %d\n", ret); return ret;
return ret;
}
} }
ret = drm_agp_info(rdev->ddev, &info); ret = drm_agp_info(rdev->ddev, &info);
......
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