diff options
author | Zhenyu Wang <zhenyu.z.wang@intel.com> | 2008-10-17 01:15:48 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2008-10-22 23:42:26 -0400 |
commit | 863842736fb4571b22e0f7f4696bf13eeec57166 (patch) | |
tree | 4a3403a8e0577f7dc562f8e2bf7b4071fc0c6be4 /drivers/gpu | |
parent | e9d21d7f5ae1e625f3687d88bb50b00478c533ad (diff) |
drm: Set cliprects to NULL when changing drawable to having 0 cliprects.
This avoids setting the cliprects pointer to a zero-sized allocation.
Signed-off-by: Zhenyu Wang <zhenyu.z.wang@intel.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/drm_drawable.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_drawable.c b/drivers/gpu/drm/drm_drawable.c index 1839c57663c5..70b15d1b8f54 100644 --- a/drivers/gpu/drm/drm_drawable.c +++ b/drivers/gpu/drm/drm_drawable.c | |||
@@ -111,7 +111,9 @@ int drm_update_drawable_info(struct drm_device *dev, void *data, struct drm_file | |||
111 | 111 | ||
112 | switch (update->type) { | 112 | switch (update->type) { |
113 | case DRM_DRAWABLE_CLIPRECTS: | 113 | case DRM_DRAWABLE_CLIPRECTS: |
114 | if (update->num != info->num_rects) { | 114 | if (update->num == 0) |
115 | rects = NULL; | ||
116 | else if (update->num != info->num_rects) { | ||
115 | rects = drm_alloc(update->num * sizeof(struct drm_clip_rect), | 117 | rects = drm_alloc(update->num * sizeof(struct drm_clip_rect), |
116 | DRM_MEM_BUFS); | 118 | DRM_MEM_BUFS); |
117 | } else | 119 | } else |