From 09a461ca6d05b0c6e82aeca158bad6549ba84904 Mon Sep 17 00:00:00 2001
From: Zhenyu Wang <[EMAIL PROTECTED]>
Date: Fri, 17 Oct 2008 11:20:14 +0800
Subject: [PATCH] drm: fix stalled cliprects when update drawable info with zero 
rects.

When passed in drawable's cliprect number as zero, we may
still alloc and leave a stalled cliprects. Fix by clean up
cliprects in that case.

Signed-off-by: Zhenyu Wang <[EMAIL PROTECTED]>
---
 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 1839c57..70b15d1 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
 
        switch (update->type) {
        case DRM_DRAWABLE_CLIPRECTS:
-               if (update->num != info->num_rects) {
+               if (update->num == 0)
+                       rects = NULL;
+               else if (update->num != info->num_rects) {
                        rects = drm_alloc(update->num * sizeof(struct 
drm_clip_rect),
                                         DRM_MEM_BUFS);
                } else
-- 
1.5.6.5

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827

Attachment: signature.asc
Description: Digital signature

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to