Skip to contentSkip to conversation

vmwgfx: strange loop in vmw_kms_update_layout_ioctl()

DISCUSSION Xi Wang 1 participant 1 message Nov 24, 2011

lore
Share & tools
lore

Xi Wang

author
#0 lore raw

Hi,

I came across this code snippet at vmwgfx_kms.c:2000. The loop variable i is never used and rects is checked again and again. Should it be something like rects[i].x instead of rects->x? Thanks.

        for (i = 0; i < arg->num_outputs; ++i) {
                if (rects->x < 0 ||
                    rects->y < 0 ||
                    rects->x + rects->w > mode_config->max_width ||
                    rects->y + rects->h > mode_config->max_height) {
                        DRM_ERROR("Invalid GUI layout.\n");
                        ret = -EINVAL;
                        goto out_free;
                }
        }

- xi