From: Zhen Lei <thunder.leizhen@huawei.com>
To: VMware Graphics <linux-graphics-maintainer@vmware.com>,
Sinclair Yeh <syeh@vmware.com>,
Thomas Hellstrom <thellstrom@vmware.com>,
David Airlie <airlied@linux.ie>,
DRM DRIVER <dri-devel@lists.freedesktop.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Cc: Zefan Li <lizefan@huawei.com>, Xinwei Hu <huxinwei@huawei.com>,
"Tianhong Ding" <dingtianhong@huawei.com>,
Hanjun Guo <guohanjun@huawei.com>,
Zhen Lei <thunder.leizhen@huawei.com>
Subject: [PATCH 1/1] drm/vmwgfx: remove an unnecessary check
Date: Tue, 11 Apr 2017 16:45:48 +0800 [thread overview]
Message-ID: <1491900348-16352-1-git-send-email-thunder.leizhen@huawei.com> (raw)
commit e7e11f995642 ("drm/vmwgfx: fix integer overflow in vmw_surface_define_ioctl()")
ensures that each req->mip_levels[i] <= DRM_VMW_MAX_MIP_LEVELS, It would be easy to
conclude that the sum of req->mip_levels[i] (i = 0, ..., DRM_VMW_MAX_SURFACE_FACES - 1)
is less than or equal to (DRM_VMW_MAX_SURFACE_FACES * DRM_VMW_MAX_MIP_LEVELS).
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
index 05fa092..4520b1f 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
@@ -719,8 +719,7 @@ int vmw_surface_define_ioctl(struct drm_device *dev, void *data,
num_sizes += req->mip_levels[i];
}
- if (num_sizes > DRM_VMW_MAX_SURFACE_FACES * DRM_VMW_MAX_MIP_LEVELS ||
- num_sizes == 0)
+ if (num_sizes == 0)
return -EINVAL;
size = vmw_user_surface_size + 128 +
--
2.5.0
reply other threads:[~2017-04-11 8:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1491900348-16352-1-git-send-email-thunder.leizhen@huawei.com \
--to=thunder.leizhen@huawei.com \
--cc=airlied@linux.ie \
--cc=dingtianhong@huawei.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=guohanjun@huawei.com \
--cc=huxinwei@huawei.com \
--cc=linux-graphics-maintainer@vmware.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=syeh@vmware.com \
--cc=thellstrom@vmware.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®