Skip to content

Commit

Permalink
drm/radeon/kms: Forbid creation of framebuffer with no valid GEM object
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
  • Loading branch information
Jerome Glisse authored and Dave Airlie committed Jan 20, 2010
1 parent 7924e5e commit 7e71c9e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/gpu/drm/radeon/radeon_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,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);
}

Expand Down

0 comments on commit 7e71c9e

Please sign in to comment.