drop use of alloca, just use malloc/free
Reported-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
0e8ee1cf4f
commit
6c1b5cb903
|
@ -324,7 +324,7 @@ static void dispatch_dirty(ScreenPtr pScreen)
|
||||||
unsigned num_cliprects = REGION_NUM_RECTS(dirty);
|
unsigned num_cliprects = REGION_NUM_RECTS(dirty);
|
||||||
|
|
||||||
if (num_cliprects) {
|
if (num_cliprects) {
|
||||||
drmModeClip *clip = alloca(num_cliprects * sizeof(drmModeClip));
|
drmModeClip *clip = malloc(num_cliprects * sizeof(drmModeClip));
|
||||||
BoxPtr rect = REGION_RECTS(dirty);
|
BoxPtr rect = REGION_RECTS(dirty);
|
||||||
int i, ret;
|
int i, ret;
|
||||||
|
|
||||||
|
@ -338,6 +338,7 @@ static void dispatch_dirty(ScreenPtr pScreen)
|
||||||
|
|
||||||
/* TODO query connector property to see if this is needed */
|
/* TODO query connector property to see if this is needed */
|
||||||
ret = drmModeDirtyFB(ms->fd, ms->drmmode.fb_id, clip, num_cliprects);
|
ret = drmModeDirtyFB(ms->fd, ms->drmmode.fb_id, clip, num_cliprects);
|
||||||
|
free(clip);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
if (ret == -EINVAL || ret == -ENOSYS) {
|
if (ret == -EINVAL || ret == -ENOSYS) {
|
||||||
ms->dirty_enabled = FALSE;
|
ms->dirty_enabled = FALSE;
|
||||||
|
|
Loading…
Reference in New Issue