Skip to content

Commit

Permalink
drm/radeon/kms/agp The wrong AGP chipset can cause a NULL pointer der…
Browse files Browse the repository at this point in the history
…eference

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: Robert Fitzsimons <robfitz@273k.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Robert Fitzsimons authored and Dave Airlie committed Apr 28, 2010
1 parent 797fd5b commit ccb2ad5
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions drivers/gpu/drm/radeon/radeon_agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,10 @@ int radeon_agp_init(struct radeon_device *rdev)
int ret;

/* Acquire AGP. */
if (!rdev->ddev->agp->acquired) {
ret = drm_agp_acquire(rdev->ddev);
if (ret) {
DRM_ERROR("Unable to acquire AGP: %d\n", ret);
return ret;
}
ret = drm_agp_acquire(rdev->ddev);
if (ret) {
DRM_ERROR("Unable to acquire AGP: %d\n", ret);
return ret;
}

ret = drm_agp_info(rdev->ddev, &info);
Expand Down

0 comments on commit ccb2ad5

Please sign in to comment.