From: Xi Wang Subject: vmwgfx: strange loop in vmw_kms_update_layout_ioctl() Date: Thu, 24 Nov 2011 12:23:04 -0500 Message-ID: <5121FD42-3181-4C12-B75B-CFFEC3011082@gmail.com> Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-iy0-f177.google.com (mail-iy0-f177.google.com [209.85.210.177]) by gabe.freedesktop.org (Postfix) with ESMTP id C277D9E7A1 for ; Thu, 24 Nov 2011 09:23:07 -0800 (PST) Received: by iapp10 with SMTP id p10so3737438iap.36 for ; Thu, 24 Nov 2011 09:23:07 -0800 (PST) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org 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