xf86-video-modesetting: src/driver.c

Dave Airlie airlied at kemper.freedesktop.org
Sat Apr 14 07:02:26 PDT 2012


 src/driver.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 87ddde9511d01138a10f38356545923d758e5408
Author: Dave Airlie <airlied at redhat.com>
Date:   Sat Apr 14 15:01:16 2012 +0100

    drop use of alloca, just use malloc/free
    
    Reported-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Signed-off-by: Dave Airlie <airlied at redhat.com>

diff --git a/src/driver.c b/src/driver.c
index 87431ff..95d6b90 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -324,7 +324,7 @@ static void dispatch_dirty(ScreenPtr pScreen)
     unsigned num_cliprects = REGION_NUM_RECTS(dirty);
 
     if (num_cliprects) {
-	drmModeClip *clip = alloca(num_cliprects * sizeof(drmModeClip));
+	drmModeClip *clip = malloc(num_cliprects * sizeof(drmModeClip));
 	BoxPtr rect = REGION_RECTS(dirty);
 	int i, ret;
 	    
@@ -338,6 +338,7 @@ static void dispatch_dirty(ScreenPtr pScreen)
 
 	/* TODO query connector property to see if this is needed */
 	ret = drmModeDirtyFB(ms->fd, ms->drmmode.fb_id, clip, num_cliprects);
+	free(clip);
 	if (ret) {
 	    if (ret == -EINVAL || ret == -ENOSYS) {
 		ms->dirty_enabled = FALSE;


More information about the xorg-commit mailing list