Commit 618c75e4 authored by Sascha Hauer's avatar Sascha Hauer Committed by Dave Airlie

drm: fix fbs in DRM_IOCTL_MODE_GETRESOURCES ioctl

The DRM_IOCTL_MODE_GETRESOURCES ioctl just returns bogus framebuffers.
That is because the framebuffers for each file are in the filp_head
member of struct drm_framebuffer, not in the head member.
Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 06e86849
...@@ -1113,7 +1113,7 @@ int drm_mode_getresources(struct drm_device *dev, void *data, ...@@ -1113,7 +1113,7 @@ int drm_mode_getresources(struct drm_device *dev, void *data,
if (card_res->count_fbs >= fb_count) { if (card_res->count_fbs >= fb_count) {
copied = 0; copied = 0;
fb_id = (uint32_t __user *)(unsigned long)card_res->fb_id_ptr; fb_id = (uint32_t __user *)(unsigned long)card_res->fb_id_ptr;
list_for_each_entry(fb, &file_priv->fbs, head) { list_for_each_entry(fb, &file_priv->fbs, filp_head) {
if (put_user(fb->base.id, fb_id + copied)) { if (put_user(fb->base.id, fb_id + copied)) {
ret = -EFAULT; ret = -EFAULT;
goto out; goto out;
......
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