Skip to contentSkip to conversation

drm/radeon/kms: Forbid creation of framebuffer with no valid GEM object

PATCH New Jerome Glisse 1 participant 1 message Jan 17, 2010

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

PATCH 1/2 drm/radeon/kms: Forbid creation of framebuffer with no valid GEM object

This will avoid oops if at later point the fb is use. Trying to create a framebuffer with no valid GEM object is bogus and should be forbidden as this patch does.

---
 drivers/gpu/drm/radeon/radeon_display.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
drivers/gpu/drm/radeon/radeon_display.c +5 -1
index 3ff34a9..9a2fd1b 100644
@@ -714,7 +714,11 @@ radeon_user_framebuffer_create(struct drm_device *dev,
 	struct drm_gem_object *obj;
 
 	obj = drm_gem_object_lookup(dev, file_priv, mode_cmd->handle);
-
+	if (obj ==  NULL) {
+		dev_err(&dev->pdev->dev, "No GEM object associated to handle 0x%08X, "
+			"can't create framebuffer\n", mode_cmd->handle);
+		return NULL;
+	}
 	return radeon_framebuffer_create(dev, mode_cmd, obj);
 }
 
Signature · 10 lines
1.6.5.2


------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
--