Skip to contentSkip to conversation

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

PATCH New Robert Fitzsimons 1 participant 1 message Apr 24, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/gpu/drm/radeon/radeon_agp.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
drivers/gpu/drm/radeon/radeon_agp.c +4 -6
index c445779..28e473f 100644
@@ -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);
Signature · 1 line
1.7.0